PlatformCALayerRemote.h [plain text]
#ifndef PlatformCALayerRemote_h
#define PlatformCALayerRemote_h
#include "RemoteLayerTreeTransaction.h"
#include <WebCore/PlatformCALayer.h>
#include <WebCore/PlatformLayer.h>
#include <WebCore/TileController.h>
namespace WebCore {
class LayerPool;
}
namespace WebKit {
class RemoteLayerTreeContext;
class PlatformCALayerRemote : public WebCore::PlatformCALayer {
public:
static PassRefPtr<PlatformCALayerRemote> create(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
static PassRefPtr<PlatformCALayerRemote> create(PlatformLayer *, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
static PassRefPtr<PlatformCALayerRemote> create(const PlatformCALayerRemote&, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
virtual ~PlatformCALayerRemote();
virtual PlatformLayer* platformLayer() const override { return nullptr; }
void recursiveBuildTransaction(RemoteLayerTreeContext&, RemoteLayerTreeTransaction&);
virtual void setNeedsDisplayInRect(const WebCore::FloatRect& dirtyRect) override;
virtual void setNeedsDisplay() override;
virtual void copyContentsFromLayer(PlatformCALayer*) override;
virtual WebCore::PlatformCALayer* superlayer() const override;
virtual void removeFromSuperlayer() override;
virtual void setSublayers(const WebCore::PlatformCALayerList&) override;
virtual void removeAllSublayers() override;
virtual void appendSublayer(WebCore::PlatformCALayer&) override;
virtual void insertSublayer(WebCore::PlatformCALayer&, size_t index) override;
virtual void replaceSublayer(WebCore::PlatformCALayer& reference, WebCore::PlatformCALayer&) override;
virtual const WebCore::PlatformCALayerList* customSublayers() const override { return nullptr; }
virtual void adoptSublayers(WebCore::PlatformCALayer& source) override;
virtual void addAnimationForKey(const String& key, WebCore::PlatformCAAnimation&) override;
virtual void removeAnimationForKey(const String& key) override;
virtual PassRefPtr<WebCore::PlatformCAAnimation> animationForKey(const String& key) override;
virtual void animationStarted(const String& key, CFTimeInterval beginTime) override;
virtual void animationEnded(const String& key) override;
virtual void setMask(WebCore::PlatformCALayer*) override;
virtual bool isOpaque() const override;
virtual void setOpaque(bool) override;
virtual WebCore::FloatRect bounds() const override;
virtual void setBounds(const WebCore::FloatRect&) override;
virtual WebCore::FloatPoint3D position() const override;
virtual void setPosition(const WebCore::FloatPoint3D&) override;
virtual WebCore::FloatPoint3D anchorPoint() const override;
virtual void setAnchorPoint(const WebCore::FloatPoint3D&) override;
virtual WebCore::TransformationMatrix transform() const override;
virtual void setTransform(const WebCore::TransformationMatrix&) override;
virtual WebCore::TransformationMatrix sublayerTransform() const override;
virtual void setSublayerTransform(const WebCore::TransformationMatrix&) override;
virtual void setHidden(bool) override;
virtual void setBackingStoreAttached(bool) override;
virtual bool backingStoreAttached() const override;
virtual bool backingContributesToMemoryEstimate() const override { return backingStoreAttached(); }
virtual void setGeometryFlipped(bool) override;
virtual bool isDoubleSided() const override;
virtual void setDoubleSided(bool) override;
virtual bool masksToBounds() const override;
virtual void setMasksToBounds(bool) override;
virtual bool acceleratesDrawing() const override;
virtual void setAcceleratesDrawing(bool) override;
virtual CFTypeRef contents() const override;
virtual void setContents(CFTypeRef) override;
virtual void setContentsRect(const WebCore::FloatRect&) override;
virtual void setMinificationFilter(WebCore::PlatformCALayer::FilterType) override;
virtual void setMagnificationFilter(WebCore::PlatformCALayer::FilterType) override;
virtual WebCore::Color backgroundColor() const override;
virtual void setBackgroundColor(const WebCore::Color&) override;
virtual void setBorderWidth(float) override;
virtual void setBorderColor(const WebCore::Color&) override;
virtual float opacity() const override;
virtual void setOpacity(float) override;
virtual void setFilters(const WebCore::FilterOperations&) override;
static bool filtersCanBeComposited(const WebCore::FilterOperations&);
virtual void copyFiltersFrom(const WebCore::PlatformCALayer&) override;
#if ENABLE(CSS_COMPOSITING)
virtual void setBlendMode(WebCore::BlendMode) override;
#endif
virtual void setName(const String&) override;
virtual void setSpeed(float) override;
virtual void setTimeOffset(CFTimeInterval) override;
virtual float contentsScale() const override;
virtual void setContentsScale(float) override;
virtual float cornerRadius() const override;
virtual void setCornerRadius(float) override;
virtual void setEdgeAntialiasingMask(unsigned) override;
virtual WebCore::FloatRoundedRect shapeRoundedRect() const override;
virtual void setShapeRoundedRect(const WebCore::FloatRoundedRect&) override;
virtual WebCore::Path shapePath() const override;
virtual void setShapePath(const WebCore::Path&) override;
virtual WebCore::WindRule shapeWindRule() const override;
virtual void setShapeWindRule(WebCore::WindRule) override;
virtual WebCore::GraphicsLayer::CustomAppearance customAppearance() const override;
virtual void updateCustomAppearance(WebCore::GraphicsLayer::CustomAppearance) override;
virtual WebCore::TiledBacking* tiledBacking() override { return nullptr; }
virtual PassRefPtr<WebCore::PlatformCALayer> clone(WebCore::PlatformCALayerClient* owner) const override;
virtual PassRefPtr<PlatformCALayer> createCompatibleLayer(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient*) const override;
virtual void enumerateRectsBeingDrawn(CGContextRef, void (^block)(CGRect)) override;
virtual uint32_t hostingContextID();
void setClonedLayer(const PlatformCALayer*);
RemoteLayerTreeTransaction::LayerProperties& properties() { return m_properties; }
const RemoteLayerTreeTransaction::LayerProperties& properties() const { return m_properties; }
void didCommit();
void clearContext() { m_context = nullptr; }
RemoteLayerTreeContext* context() const { return m_context; }
protected:
PlatformCALayerRemote(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext& context);
PlatformCALayerRemote(const PlatformCALayerRemote&, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
void updateClonedLayerProperties(PlatformCALayerRemote& clone, bool copyContents = true) const;
private:
virtual bool isPlatformCALayerRemote() const override { return true; }
void ensureBackingStore();
void updateBackingStore();
void removeSublayer(PlatformCALayerRemote*);
bool requiresCustomAppearanceUpdateOnBoundsChange() const;
virtual WebCore::LayerPool& layerPool() override;
RemoteLayerTreeTransaction::LayerProperties m_properties;
WebCore::PlatformCALayerList m_children;
PlatformCALayerRemote* m_superlayer;
PlatformCALayerRemote* m_maskLayer;
HashMap<String, RefPtr<WebCore::PlatformCAAnimation>> m_animations;
bool m_acceleratesDrawing;
RemoteLayerTreeContext* m_context;
};
}
SPECIALIZE_TYPE_TRAITS_PLATFORM_CALAYER(WebKit::PlatformCALayerRemote, isPlatformCALayerRemote())
#endif // PlatformCALayerRemote_h