AcceleratedDrawingAreaProxy.h [plain text]
#pragma once
#include "DrawingAreaProxy.h"
#include "LayerTreeContext.h"
namespace WebKit {
class CoordinatedLayerTreeHostProxy;
class AcceleratedDrawingAreaProxy : public DrawingAreaProxy {
public:
explicit AcceleratedDrawingAreaProxy(WebPageProxy&);
virtual ~AcceleratedDrawingAreaProxy();
bool isInAcceleratedCompositingMode() const { return alwaysUseCompositing() || !m_layerTreeContext.isEmpty(); }
void visibilityDidChange();
#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
CoordinatedLayerTreeHostProxy& coordinatedLayerTreeHostProxy() const { return *m_coordinatedLayerTreeHostProxy.get(); }
#endif
#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
void setNativeSurfaceHandleForCompositing(uint64_t);
void destroyNativeSurfaceHandleForCompositing();
#endif
void dispatchAfterEnsuringDrawing(std::function<void(CallbackBase::Error)>) override;
protected:
void sizeDidChange() override;
void deviceScaleFactorDidChange() override;
void waitForBackingStoreUpdateOnNextPaint() override;
void didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo&, const LayerTreeContext&) override;
void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override;
void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&) override;
void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override;
enum RespondImmediatelyOrNot { DoNotRespondImmediately, RespondImmediately };
void backingStoreStateDidChange(RespondImmediatelyOrNot);
void sendUpdateBackingStoreState(RespondImmediatelyOrNot);
void waitForAndDispatchDidUpdateBackingStoreState();
virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
void exitAcceleratedCompositingMode();
void updateAcceleratedCompositingMode(const LayerTreeContext&);
bool alwaysUseCompositing() const;
#if USE(COORDINATED_GRAPHICS_MULTIPROCESS)
std::unique_ptr<CoordinatedLayerTreeHostProxy> m_coordinatedLayerTreeHostProxy;
#endif
uint64_t m_currentBackingStoreStateID { 0 };
uint64_t m_nextBackingStoreStateID { 0 };
LayerTreeContext m_layerTreeContext;
bool m_isWaitingForDidUpdateBackingStoreState { false };
bool m_hasReceivedFirstUpdate { false };
#if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
uint64_t m_pendingNativeSurfaceHandleForCompositing { 0 };
#endif
};
}