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

Unified Diff: samplecode/SamplePatch.cpp

Issue 272593002: add localmatrix-shader (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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: samplecode/SamplePatch.cpp
diff --git a/samplecode/SamplePatch.cpp b/samplecode/SamplePatch.cpp
index 5f39eda37acc7a53ea2b29a880b31e89a81ac9b6..ff3af45d0eff740534baa8544d5ce85f0acfbb56 100644
--- a/samplecode/SamplePatch.cpp
+++ b/samplecode/SamplePatch.cpp
@@ -295,9 +295,18 @@ protected:
canvas->translate(0, SkIntToScalar(300));
paint.setAntiAlias(false);
- paint.setShader(fShader1);
+
+ {
+ static int gAngle;
+ SkMatrix m;
+ m.setRotate(SkIntToScalar(gAngle++));
+ SkShader* s = SkShader::CreateLocalMatrixShader(fShader1, m);
+ paint.setShader(s)->unref();
+ }
patch.setBounds(fSize1.fX, fSize1.fY);
drawpatches(canvas, paint, 10, 10, &patch);
+
+ this->inval(NULL);
}
class PtClick : public Click {

Powered by Google App Engine
This is Rietveld 408576698