Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: Source/platform/graphics/Pattern.h

Issue 358893002: Use newImageSnapshot() to get an image from a Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Corrections Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/ImageBufferSurface.cpp ('k') | Source/platform/graphics/Pattern.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/Pattern.h
diff --git a/Source/platform/graphics/Pattern.h b/Source/platform/graphics/Pattern.h
index 49fd69f8671160aec150c09d391aecfdf876f3f1..8d21b53273f0830875fb48b96496d3078ed4711b 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; }
+
+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
« no previous file with comments | « Source/platform/graphics/ImageBufferSurface.cpp ('k') | Source/platform/graphics/Pattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698