summaryrefslogtreecommitdiff
path: root/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h')
-rw-r--r--Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h136
1 files changed, 68 insertions, 68 deletions
diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
index e3340d346..42ed713d3 100644
--- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
+++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
@@ -20,7 +20,7 @@
#ifndef GraphicsLayerTextureMapper_h
#define GraphicsLayerTextureMapper_h
-#if USE(TEXTURE_MAPPER)
+#if !USE(COORDINATED_GRAPHICS)
#include "GraphicsLayer.h"
#include "GraphicsLayerClient.h"
@@ -32,70 +32,68 @@
namespace WebCore {
-class GraphicsLayerTextureMapper : public GraphicsLayer, public TextureMapperPlatformLayer::Client {
+class GraphicsLayerTextureMapper final : public GraphicsLayer, TextureMapperPlatformLayer::Client {
public:
- explicit GraphicsLayerTextureMapper(GraphicsLayerClient*);
+ explicit GraphicsLayerTextureMapper(Type, GraphicsLayerClient&);
virtual ~GraphicsLayerTextureMapper();
- void setScrollClient(TextureMapperLayer::ScrollingClient* client) { m_layer->setScrollClient(client); }
- void setID(uint32_t id) { m_layer->setID(id); }
-
- // reimps from GraphicsLayer.h
- virtual void setNeedsDisplay();
- virtual void setContentsNeedsDisplay();
- virtual void setNeedsDisplayInRect(const FloatRect&, ShouldClipToLayer = ClipToLayer);
- virtual bool setChildren(const Vector<GraphicsLayer*>&);
- virtual void addChild(GraphicsLayer*);
- virtual void addChildAtIndex(GraphicsLayer*, int index);
- virtual void addChildAbove(GraphicsLayer* layer, GraphicsLayer* sibling);
- virtual void addChildBelow(GraphicsLayer* layer, GraphicsLayer* sibling);
- virtual bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild);
- virtual void setMaskLayer(GraphicsLayer* layer);
- virtual void setPosition(const FloatPoint& p);
- virtual void setAnchorPoint(const FloatPoint3D& p);
- virtual void setSize(const FloatSize& size);
- virtual void setTransform(const TransformationMatrix& t);
- virtual void setChildrenTransform(const TransformationMatrix& t);
- virtual void setPreserves3D(bool b);
- virtual void setMasksToBounds(bool b);
- virtual void setDrawsContent(bool b);
- virtual void setContentsVisible(bool);
- virtual void setContentsOpaque(bool b);
- virtual void setBackfaceVisibility(bool b);
- virtual void setOpacity(float opacity);
- virtual void setContentsRect(const IntRect& r);
- virtual void setReplicatedByLayer(GraphicsLayer*);
- virtual void setContentsToImage(Image*);
- virtual void setContentsToSolidColor(const Color&);
- Color solidColor() const { return m_solidColor; }
- virtual void setContentsToMedia(PlatformLayer*);
- virtual void setContentsToCanvas(PlatformLayer* canvas) { setContentsToMedia(canvas); }
- virtual void setShowDebugBorder(bool) override;
- virtual void setDebugBorder(const Color&, float width) override;
- virtual void setShowRepaintCounter(bool) override;
- virtual void flushCompositingState(const FloatRect&);
- virtual void flushCompositingStateForThisLayerOnly();
- virtual void setName(const String& name);
- virtual bool hasContentsLayer() const { return m_contentsLayer; }
- virtual PlatformLayer* platformLayer() const { return m_contentsLayer; }
-
- inline int changeMask() const { return m_changeMask; }
-
- virtual bool addAnimation(const KeyframeValueList&, const IntSize&, const Animation*, const String&, double);
- virtual void pauseAnimation(const String&, double);
- virtual void removeAnimation(const String&);
- void setAnimations(const GraphicsLayerAnimations&);
-
- TextureMapperLayer* layer() const { return m_layer.get(); }
+ void setScrollClient(TextureMapperLayer::ScrollingClient* client) { m_layer.setScrollClient(client); }
+ void setID(uint32_t id) { m_layer.setID(id); }
+
+ // GraphicsLayer
+ bool setChildren(const Vector<GraphicsLayer*>&) override;
+ void addChild(GraphicsLayer*) override;
+ void addChildAtIndex(GraphicsLayer*, int index) override;
+ void addChildAbove(GraphicsLayer*, GraphicsLayer* sibling) override;
+ void addChildBelow(GraphicsLayer*, GraphicsLayer* sibling) override;
+ bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild) override;
+
+ void setMaskLayer(GraphicsLayer*) override;
+ void setReplicatedByLayer(GraphicsLayer*) override;
+ void setPosition(const FloatPoint&) override;
+ void setAnchorPoint(const FloatPoint3D&) override;
+ void setSize(const FloatSize&) override;
+ void setTransform(const TransformationMatrix&) override;
+ void setChildrenTransform(const TransformationMatrix&) override;
+ void setPreserves3D(bool) override;
+ void setMasksToBounds(bool) override;
+ void setDrawsContent(bool) override;
+ void setContentsVisible(bool) override;
+ void setContentsOpaque(bool) override;
+ void setBackfaceVisibility(bool) override;
+ void setOpacity(float) override;
+ bool setFilters(const FilterOperations&) override;
+
+ void setNeedsDisplay() override;
+ void setNeedsDisplayInRect(const FloatRect&, ShouldClipToLayer = ClipToLayer) override;
+ void setContentsNeedsDisplay() override;
+ void setContentsRect(const FloatRect&) override;
+
+ bool addAnimation(const KeyframeValueList&, const FloatSize&, const Animation*, const String&, double) override;
+ void pauseAnimation(const String&, double) override;
+ void removeAnimation(const String&) override;
+
+ void setContentsToImage(Image*) override;
+ void setContentsToSolidColor(const Color&) override;
+ void setContentsToPlatformLayer(PlatformLayer*, ContentsLayerPurpose) override;
+ bool usesContentsLayer() const override { return m_contentsLayer; }
+ PlatformLayer* platformLayer() const override { return m_contentsLayer; }
+
+ void setShowDebugBorder(bool) override;
+ void setDebugBorder(const Color&, float width) override;
+ void setShowRepaintCounter(bool) override;
+
+ void flushCompositingState(const FloatRect&) override;
+ void flushCompositingStateForThisLayerOnly() override;
+
+ void updateBackingStoreIncludingSubLayers();
+
+ TextureMapperLayer& layer() { return m_layer; }
void didCommitScrollOffset(const IntSize&);
void setIsScrollable(bool);
bool isScrollable() const { return m_isScrollable; }
-#if ENABLE(CSS_FILTERS)
- virtual bool setFilters(const FilterOperations&);
-#endif
-
void setFixedToViewport(bool);
bool fixedToViewport() const { return m_fixedToViewport; }
@@ -103,8 +101,15 @@ public:
float debugBorderWidth() const { return m_debugBorderWidth; }
void setRepaintCount(int);
+ void setAnimations(const TextureMapperAnimations&);
+
private:
- virtual void willBeDestroyed();
+ // GraphicsLayer
+ bool isGraphicsLayerTextureMapper() const override { return true; }
+
+ // TextureMapperPlatformLayer::Client
+ void platformLayerWillBeDestroyed() override { setContentsToPlatformLayer(0, NoContentsLayer); }
+ void setPlatformLayerNeedsDisplay() override { setContentsNeedsDisplay(); }
void commitLayerChanges();
void updateDebugBorderAndRepaintCount();
@@ -112,8 +117,7 @@ private:
void prepareBackingStoreIfNeeded();
bool shouldHaveBackingStore() const;
- virtual void platformLayerWillBeDestroyed() override { setContentsToMedia(0); }
- virtual void setPlatformLayerNeedsDisplay() override { setContentsNeedsDisplay(); }
+ bool filtersCanBeComposited(const FilterOperations&) const;
// This set of flags help us defer which properties of the layer have been
// modified by the compositor, so we can know what to look for in the next flush.
@@ -160,7 +164,7 @@ private:
};
void notifyChange(ChangeMask);
- OwnPtr<TextureMapperLayer> m_layer;
+ TextureMapperLayer m_layer;
RefPtr<TextureMapperTiledBackingStore> m_compositedImage;
NativeImagePtr m_compositedNativeImagePtr;
RefPtr<TextureMapperBackingStore> m_backingStore;
@@ -175,21 +179,17 @@ private:
TextureMapperPlatformLayer* m_contentsLayer;
FloatRect m_needsDisplayRect;
- GraphicsLayerAnimations m_animations;
+ TextureMapperAnimations m_animations;
double m_animationStartTime;
IntSize m_committedScrollOffset;
bool m_isScrollable;
};
-inline static GraphicsLayerTextureMapper* toGraphicsLayerTextureMapper(GraphicsLayer* layer)
-{
- return static_cast<GraphicsLayerTextureMapper*>(layer);
-}
+} // namespace WebCore
-TextureMapperLayer* toTextureMapperLayer(GraphicsLayer*);
+SPECIALIZE_TYPE_TRAITS_GRAPHICSLAYER(WebCore::GraphicsLayerTextureMapper, isGraphicsLayerTextureMapper())
-}
#endif
#endif // GraphicsLayerTextureMapper_h