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

Unified Diff: gm/tilemodes.cpp

Issue 287063009: Revert of remove unused (by clients) SkUnitMapper (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 | « gm/shadertext3.cpp ('k') | gm/tilemodes_scaled.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/tilemodes.cpp
diff --git a/gm/tilemodes.cpp b/gm/tilemodes.cpp
index 99d3a4708b1c48c3a51467468a87c19b3b7d058c..e04c52ae0fd6e5423ed9016e254e860bb92d20df 100644
--- a/gm/tilemodes.cpp
+++ b/gm/tilemodes.cpp
@@ -16,6 +16,7 @@
// effects
#include "SkGradientShader.h"
+#include "SkUnitMappers.h"
#include "SkBlurDrawLooper.h"
static void makebm(SkBitmap* bm, SkColorType ct, int w, int h) {
@@ -28,9 +29,16 @@
SkScalar pos[] = { 0, SK_Scalar1/2, SK_Scalar1 };
SkPaint paint;
+ SkUnitMapper* um = NULL;
+
+ um = new SkCosineMapper;
+// um = new SkDiscreteMapper(12);
+
+ SkAutoUnref au(um);
+
paint.setDither(true);
paint.setShader(SkGradientShader::CreateLinear(pts, colors, pos,
- SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode))->unref();
+ SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode, um))->unref();
canvas.drawPaint(paint);
}
« no previous file with comments | « gm/shadertext3.cpp ('k') | gm/tilemodes_scaled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698