RemoteLayerTreeContext.h [plain text]
#ifndef RemoteLayerTreeContext_h
#define RemoteLayerTreeContext_h
#include "LayerTreeContext.h"
#include "RemoteLayerBackingStoreCollection.h"
#include "RemoteLayerTreeTransaction.h"
#include "WebPage.h"
#include <WebCore/GraphicsLayerFactory.h>
#include <WebCore/LayerPool.h>
#include <WebCore/PlatformCALayer.h>
#include <wtf/Vector.h>
namespace WebKit {
class PlatformCALayerRemote;
class WebPage;
class RemoteLayerTreeContext : public WebCore::GraphicsLayerFactory {
public:
explicit RemoteLayerTreeContext(WebPage&);
~RemoteLayerTreeContext();
void layerWasCreated(PlatformCALayerRemote&, WebCore::PlatformCALayer::LayerType);
void layerWillBeDestroyed(PlatformCALayerRemote&);
void backingStoreWasCreated(RemoteLayerBackingStore&);
void backingStoreWillBeDestroyed(RemoteLayerBackingStore&);
bool backingStoreWillBeDisplayed(RemoteLayerBackingStore&);
WebCore::LayerPool& layerPool() { return m_layerPool; }
float deviceScaleFactor() const { return m_webPage.deviceScaleFactor(); }
LayerHostingMode layerHostingMode() const { return m_webPage.layerHostingMode(); }
void buildTransaction(RemoteLayerTreeTransaction&, WebCore::PlatformCALayer& rootLayer);
void layerPropertyChangedWhileBuildingTransaction(PlatformCALayerRemote&);
void animationDidStart(WebCore::GraphicsLayer::PlatformLayerID, const String& key, double startTime);
void animationDidEnd(WebCore::GraphicsLayer::PlatformLayerID, const String& key);
void willStartAnimationOnLayer(PlatformCALayerRemote&);
RemoteLayerBackingStoreCollection& backingStoreCollection() { return m_backingStoreCollection; }
private:
std::unique_ptr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayer::Type, WebCore::GraphicsLayerClient&) override;
WebPage& m_webPage;
HashMap<WebCore::GraphicsLayer::PlatformLayerID, RemoteLayerTreeTransaction::LayerCreationProperties> m_createdLayers;
Vector<WebCore::GraphicsLayer::PlatformLayerID> m_destroyedLayers;
HashMap<WebCore::GraphicsLayer::PlatformLayerID, PlatformCALayerRemote*> m_liveLayers;
HashMap<WebCore::GraphicsLayer::PlatformLayerID, PlatformCALayerRemote*> m_layersWithAnimations;
RemoteLayerBackingStoreCollection m_backingStoreCollection;
RemoteLayerTreeTransaction* m_currentTransaction;
WebCore::LayerPool m_layerPool;
};
}
#endif // RemoteLayerTreeContext_h