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

Unified Diff: Source/platform/graphics/GraphicsContextState.cpp

Issue 358893002: Use newImageSnapshot() to get an image from a Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Bitmap caching for Shaders/Patterns from StaticBitmapImage/SkImage Created 6 years, 4 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: Source/platform/graphics/GraphicsContextState.cpp
diff --git a/Source/platform/graphics/GraphicsContextState.cpp b/Source/platform/graphics/GraphicsContextState.cpp
index 603f976ec39ab4677e5fc2f80efa12eb5a54d199..bc7df9f4422bece29c8036d1efe853827104f2f1 100644
--- a/Source/platform/graphics/GraphicsContextState.cpp
+++ b/Source/platform/graphics/GraphicsContextState.cpp
@@ -114,13 +114,13 @@ void GraphicsContextState::clearStrokeGradient()
m_strokePaint.setColor(applyAlpha(m_strokeData.color().rgb()));
}
-void GraphicsContextState::setStrokePattern(const PassRefPtr<Pattern> pattern)
+void GraphicsContextState::setStrokePattern(const PassRefPtr<Pattern> pattern, SkShader::ShaderLocation preferredLocation)
{
m_strokeData.setColor(Color::black);
m_strokeData.clearGradient();
m_strokeData.setPattern(pattern);
m_strokePaint.setColor(applyAlpha(SK_ColorBLACK));
- m_strokePaint.setShader(m_strokeData.pattern()->shader());
+ m_strokePaint.setShader(m_strokeData.pattern()->shader(preferredLocation));
}
void GraphicsContextState::clearStrokePattern()
@@ -173,13 +173,13 @@ void GraphicsContextState::clearFillGradient()
m_fillPaint.setColor(applyAlpha(m_fillColor.rgb()));
}
-void GraphicsContextState::setFillPattern(const PassRefPtr<Pattern> pattern)
+void GraphicsContextState::setFillPattern(const PassRefPtr<Pattern> pattern, SkShader::ShaderLocation preferredLocation)
{
m_fillColor = Color::black;
m_fillGradient.clear();
m_fillPattern = pattern;
m_fillPaint.setColor(applyAlpha(SK_ColorBLACK));
- m_fillPaint.setShader(m_fillPattern->shader());
+ m_fillPaint.setShader(m_fillPattern->shader(preferredLocation));
}
void GraphicsContextState::clearFillPattern()

Powered by Google App Engine
This is Rietveld 408576698