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

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
« no previous file with comments | « include/core/SkShader.h ('k') | src/core/SkLocalMatrixShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SamplePatch.cpp
diff --git a/samplecode/SamplePatch.cpp b/samplecode/SamplePatch.cpp
index 5f39eda37acc7a53ea2b29a880b31e89a81ac9b6..88bd06f7f0f10e4993e9f69b247cc508b5f9bed5 100644
--- a/samplecode/SamplePatch.cpp
+++ b/samplecode/SamplePatch.cpp
@@ -296,8 +296,23 @@ protected:
paint.setAntiAlias(false);
paint.setShader(fShader1);
+ {
+ SkMatrix m;
+ m.setSkew(1, 0);
+ SkShader* s = SkShader::CreateLocalMatrixShader(paint.getShader(), m);
+ paint.setShader(s)->unref();
+ }
+ {
+ static int gAngle;
+ SkMatrix m;
+ m.setRotate(SkIntToScalar(gAngle++));
+ SkShader* s = SkShader::CreateLocalMatrixShader(paint.getShader(), m);
+ paint.setShader(s)->unref();
+ }
patch.setBounds(fSize1.fX, fSize1.fY);
drawpatches(canvas, paint, 10, 10, &patch);
+
+ this->inval(NULL);
}
class PtClick : public Click {
« no previous file with comments | « include/core/SkShader.h ('k') | src/core/SkLocalMatrixShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698