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

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

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.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Pattern.cpp b/third_party/WebKit/Source/platform/graphics/Pattern.cpp
index 2c279181992ab079aebd65cf407deb037821f2e2..02f35e810a6f17ae012c56a3567a9ff76507120b 100644
--- a/third_party/WebKit/Source/platform/graphics/Pattern.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Pattern.cpp
@@ -60,21 +60,12 @@ Pattern::~Pattern()
adjustExternalMemoryAllocated(-m_externalMemoryAllocated);
}
-void Pattern::applyToPaint(SkPaint& paint)
+void Pattern::applyToPaint(SkPaint& paint, const SkMatrix& localMatrix) const
{
- if (!m_pattern)
- m_pattern = createShader();
+ if (!m_cachedShader || localMatrix != m_cachedShader->getLocalMatrix())
+ m_cachedShader = createShader(localMatrix);
- paint.setShader(m_pattern);
-}
-
-void Pattern::setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation)
-{
- if (patternSpaceTransformation == m_patternSpaceTransformation)
- return;
-
- m_patternSpaceTransformation = patternSpaceTransformation;
- m_pattern.reset();
+ paint.setShader(m_cachedShader);
}
void Pattern::adjustExternalMemoryAllocated(int64_t delta)
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/Pattern.h ('k') | third_party/WebKit/Source/platform/graphics/PicturePattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698