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

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

Issue 2007553002: Retire setGradientSpaceTransform, setPatternSpaceTransform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fmalita discovers SkMatrix::I() Created 4 years, 7 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
Index: third_party/WebKit/Source/platform/graphics/Pattern.h
diff --git a/third_party/WebKit/Source/platform/graphics/Pattern.h b/third_party/WebKit/Source/platform/graphics/Pattern.h
index d9736e2565b981aa69a6525bd03102e194bd9b6d..667fc94d6dd7f6bfdbbc933b0109c72717335e1c 100644
--- a/third_party/WebKit/Source/platform/graphics/Pattern.h
+++ b/third_party/WebKit/Source/platform/graphics/Pattern.h
@@ -31,13 +31,13 @@
#include "platform/PlatformExport.h"
#include "platform/graphics/Image.h"
-#include "platform/transforms/AffineTransform.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "wtf/Noncopyable.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
+class SkMatrix;
class SkPaint;
class SkPicture;
@@ -59,10 +59,7 @@ public:
RepeatMode = RepeatModeXY);
virtual ~Pattern();
- void applyToPaint(SkPaint&);
-
- void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation);
- const AffineTransform& patternSpaceTransform() const { return m_patternSpaceTransformation; }
+ void applyToPaint(SkPaint&, const SkMatrix&) const;
bool isRepeatX() const { return m_repeatMode & RepeatModeX; }
bool isRepeatY() const { return m_repeatMode & RepeatModeY; }
@@ -71,17 +68,16 @@ public:
virtual bool isTextureBacked() const { return false; }
protected:
- virtual sk_sp<SkShader> createShader() const = 0;
+ virtual sk_sp<SkShader> createShader(const SkMatrix&) const = 0;
void adjustExternalMemoryAllocated(int64_t delta);
RepeatMode m_repeatMode;
- AffineTransform m_patternSpaceTransformation;
Pattern(RepeatMode, int64_t externalMemoryAllocated = 0);
private:
- sk_sp<SkShader> m_pattern;
+ mutable sk_sp<SkShader> m_cachedShader;
int64_t m_externalMemoryAllocated;
};
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/ImagePattern.cpp ('k') | third_party/WebKit/Source/platform/graphics/Pattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698