Chromium Code Reviews| Index: Source/platform/graphics/Pattern.h |
| diff --git a/Source/platform/graphics/Pattern.h b/Source/platform/graphics/Pattern.h |
| index 49fd69f8671160aec150c09d391aecfdf876f3f1..2d8ec28e8379fac1e3831f836dad0ded48951f98 100644 |
| --- a/Source/platform/graphics/Pattern.h |
| +++ b/Source/platform/graphics/Pattern.h |
| @@ -29,7 +29,6 @@ |
| #ifndef Pattern_h |
| #define Pattern_h |
| -#include "SkShader.h" |
| #include "platform/PlatformExport.h" |
| #include "platform/graphics/Image.h" |
| #include "platform/transforms/AffineTransform.h" |
| @@ -38,6 +37,8 @@ |
| #include "wtf/RefCounted.h" |
| #include "wtf/RefPtr.h" |
| +class SkShader; |
| + |
| namespace blink { |
| class PLATFORM_EXPORT Pattern : public RefCounted<Pattern> { |
| @@ -52,20 +53,29 @@ public: |
| static PassRefPtr<Pattern> createBitmapPattern(PassRefPtr<Image> tileImage, |
| RepeatMode = RepeatModeXY); |
| - ~Pattern(); |
| + virtual ~Pattern(); |
| SkShader* shader(); |
| void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation); |
| -private: |
| - Pattern(PassRefPtr<Image>, RepeatMode); |
| + bool isRepeatX() { return m_repeatMode & RepeatModeX; } |
| + bool isRepeatY() { return m_repeatMode & RepeatModeY; } |
| + bool isRepeatXY() { return (m_repeatMode & RepeatModeXY) == RepeatModeXY; } |
|
Justin Novosad
2014/09/30 17:37:56
This could just be "return m_repeatMode == RepeatM
Rémi Piotaix
2014/09/30 17:48:12
Done.
|
| + |
| +protected: |
| + virtual PassRefPtr<SkShader> createShader() = 0; |
| + |
| + void adjustExternalMemoryAllocated(int64_t delta); |
| - RefPtr<NativeImageSkia> m_tileImage; |
| RepeatMode m_repeatMode; |
| AffineTransform m_patternSpaceTransformation; |
| + |
| + Pattern(RepeatMode, int64_t externalMemoryAllocated = 0); |
| + |
| +private: |
| RefPtr<SkShader> m_pattern; |
| - int m_externalMemoryAllocated; |
| + int64_t m_externalMemoryAllocated; |
| }; |
| } // namespace blink |