Chromium Code Reviews| Index: Source/core/platform/graphics/DrawLooper.h |
| diff --git a/Source/core/platform/graphics/DrawLooper.h b/Source/core/platform/graphics/DrawLooper.h |
| index 97a3b0d4f7b9cb969075f6816825c7597de6c765..d369671736bbec69c517bdf2d11d7d13b1457723 100644 |
| --- a/Source/core/platform/graphics/DrawLooper.h |
| +++ b/Source/core/platform/graphics/DrawLooper.h |
| @@ -31,18 +31,22 @@ |
| #ifndef DrawLooper_h |
| #define DrawLooper_h |
| +#include "Color.h" |
|
jbroman
2013/08/23 19:59:38
Blink style requires fully qualified paths here, I
|
| +#include "FloatSize.h" |
| +#include "SkRefCnt.h" |
| #include "wtf/Noncopyable.h" |
| +#include "wtf/RefCounted.h" |
| #include "wtf/RefPtr.h" |
| +#include "wtf/Vector.h" |
| +class SkBitmap; |
| class SkDrawLooper; |
| +class SkImageFilter; |
| class SkLayerDrawLooper; |
| namespace WebCore { |
| -class Color; |
| -class FloatSize; |
| - |
| -class DrawLooper { |
| +class DrawLooper : public RefCounted<DrawLooper> { |
| // Implementing the copy constructor properly would require writing code to |
| // copy the underlying SkDrawLooper. |
| WTF_MAKE_NONCOPYABLE(DrawLooper); |
| @@ -62,15 +66,40 @@ public: |
| // Callees should not modify this looper other than to iterate over it. |
| // A downcast to SkLayerDrawLooper* is tantamount to a const_cast. |
| - SkDrawLooper* skDrawLooper() const; |
| + SkDrawLooper* skDrawLooper(); |
| + SkImageFilter* imageFilter(); |
| void addUnmodifiedContent(); |
| void addShadow(const FloatSize& offset, float blur, const Color&, |
| ShadowTransformMode = ShadowRespectsTransforms, |
| ShadowAlphaMode = ShadowRespectsAlpha); |
| + bool shouldUseImageFilterToDrawBitmap(const SkBitmap&); |
| + |
| private: |
| - RefPtr<SkLayerDrawLooper> m_skDrawLooper; |
| + enum LayerType { |
| + ShadowLayer, |
| + UnmodifiedLayer |
| + }; |
| + void clearCached(); |
| + void buildCachedDrawLooper(); |
| + void buildCachedImageFilter(); |
| + |
| + struct DrawLooperLayerInfo { |
| + FloatSize m_offset; |
| + float m_blur; |
| + Color m_color; |
| + ShadowTransformMode m_shadowTransformMode; |
| + ShadowAlphaMode m_shadowAlphaMode; |
| + LayerType m_layerType; |
| + }; |
| + |
| + typedef Vector<DrawLooperLayerInfo, 2> LayerVector; |
| + |
| + LayerVector m_layerInfo; |
| + |
| + SkAutoTUnref<SkLayerDrawLooper> m_cachedDrawLooper; |
|
jbroman
2013/08/23 19:59:38
Could use RefPtr here (RefPtr can hold SkRefCnt su
|
| + SkAutoTUnref<SkImageFilter> m_cachedImageFilter; |
| }; |
| } // namespace WebCore |