diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h')
-rw-r--r-- | Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h | 59 |
1 files changed, 27 insertions, 32 deletions
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h index 87ff3f4a7..3b1c16b0b 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h @@ -20,22 +20,21 @@ #ifndef TextureMapperLayer_h #define TextureMapperLayer_h -#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) - #include "FilterOperations.h" #include "FloatRect.h" -#include "GraphicsLayerAnimation.h" #include "GraphicsLayerTransform.h" #include "TextureMapper.h" +#include "TextureMapperAnimation.h" #include "TextureMapperBackingStore.h" namespace WebCore { +class GraphicsLayer; class Region; class TextureMapperPaintOptions; class TextureMapperPlatformLayer; -class TextureMapperLayer : public GraphicsLayerAnimation::Client { +class TextureMapperLayer : public TextureMapperAnimation::Client { WTF_MAKE_NONCOPYABLE(TextureMapperLayer); WTF_MAKE_FAST_ALLOCATED; public: @@ -74,9 +73,12 @@ public: void setIsScrollable(bool isScrollable) { m_isScrollable = isScrollable; } bool isScrollable() const { return m_isScrollable; } - TextureMapper* textureMapper() const; + TextureMapper* textureMapper() const { return rootLayer().m_textureMapper; } void setTextureMapper(TextureMapper* texmap) { m_textureMapper = texmap; } +#if !USE(COORDINATED_GRAPHICS) + void setChildren(const Vector<GraphicsLayer*>&); +#endif void setChildren(const Vector<TextureMapperLayer*>&); void setMaskLayer(TextureMapperLayer*); void setReplicaLayer(TextureMapperLayer*); @@ -86,7 +88,7 @@ public: void setPreserves3D(bool); void setTransform(const TransformationMatrix&); void setChildrenTransform(const TransformationMatrix&); - void setContentsRect(const IntRect&); + void setContentsRect(const FloatRect&); void setMasksToBounds(bool); void setDrawsContent(bool); bool drawsContent() const { return m_state.drawsContent; } @@ -99,26 +101,20 @@ public: void setBackfaceVisibility(bool); void setOpacity(float); void setSolidColor(const Color&); - void setContentsTileSize(const IntSize&); - void setContentsTilePhase(const IntPoint&); -#if ENABLE(CSS_FILTERS) + void setContentsTileSize(const FloatSize&); + void setContentsTilePhase(const FloatSize&); void setFilters(const FilterOperations&); -#endif bool hasFilters() const { -#if ENABLE(CSS_FILTERS) return !m_currentFilters.isEmpty(); -#else - return false; -#endif } void setDebugVisuals(bool showDebugBorders, const Color& debugBorderColor, float debugBorderWidth, bool showRepaintCounter); bool isShowingRepaintCounter() const { return m_state.showRepaintCounter; } void setRepaintCount(int); void setContentsLayer(TextureMapperPlatformLayer*); - void setAnimations(const GraphicsLayerAnimations&); + void setAnimations(const TextureMapperAnimations&); void setFixedToViewport(bool); bool fixedToViewport() const { return m_fixedToViewport; } void setBackingStore(PassRefPtr<TextureMapperBackingStore>); @@ -134,13 +130,19 @@ public: void addChild(TextureMapperLayer*); private: - const TextureMapperLayer* rootLayer() const; + const TextureMapperLayer& rootLayer() const + { + if (m_effectTarget) + return m_effectTarget->rootLayer(); + if (m_parent) + return m_parent->rootLayer(); + return *this; + } void computeTransformsRecursive(); - static int compareGraphicsLayersZValue(const void* a, const void* b); static void sortByZOrder(Vector<TextureMapperLayer* >& array); - PassRefPtr<BitmapTexture> texture() { return m_backingStore ? m_backingStore->texture() : 0; } + RefPtr<BitmapTexture> texture() { return m_backingStore ? m_backingStore->texture() : 0; } FloatPoint adjustedPosition() const { return m_state.pos + m_scrollPositionDelta - m_userScrollOffset; } bool isAncestorFixedToViewport() const; TransformationMatrix replicaTransform(); @@ -163,12 +165,10 @@ private: void applyMask(const TextureMapperPaintOptions&); void computePatternTransformIfNeeded(); - // GraphicsLayerAnimation::Client - virtual void setAnimatedTransform(const TransformationMatrix&) override; - virtual void setAnimatedOpacity(float) override; -#if ENABLE(CSS_FILTERS) - virtual void setAnimatedFilters(const FilterOperations&) override; -#endif + // TextureMapperAnimation::Client + void setAnimatedTransform(const TransformationMatrix&) override; + void setAnimatedOpacity(float) override; + void setAnimatedFilters(const FilterOperations&) override; bool isVisible() const; enum ContentsLayerCount { @@ -191,9 +191,7 @@ private: TextureMapperPlatformLayer* m_contentsLayer; GraphicsLayerTransform m_currentTransform; float m_currentOpacity; -#if ENABLE(CSS_FILTERS) FilterOperations m_currentFilters; -#endif float m_centerZ; template<class HitTestCondition> TextureMapperLayer* hitTest(const FloatPoint&, HitTestCondition); @@ -210,14 +208,12 @@ private: TransformationMatrix childrenTransform; float opacity; FloatRect contentsRect; - IntSize contentsTileSize; - IntPoint contentsTilePhase; + FloatSize contentsTileSize; + FloatSize contentsTilePhase; TextureMapperLayer* maskLayer; TextureMapperLayer* replicaLayer; Color solidColor; -#if ENABLE(CSS_FILTERS) FilterOperations filters; -#endif Color debugBorderColor; float debugBorderWidth; int repaintCount; @@ -253,7 +249,7 @@ private: State m_state; TextureMapper* m_textureMapper; - GraphicsLayerAnimations m_animations; + TextureMapperAnimations m_animations; FloatSize m_scrollPositionDelta; bool m_fixedToViewport; uint32_t m_id; @@ -266,6 +262,5 @@ private: }; } -#endif #endif // TextureMapperLayer_h |