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

Unified Diff: samplecode/SampleAll.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 | « include/effects/SkGradientShader.h ('k') | samplecode/SampleGradients.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleAll.cpp
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 92fe258dd6a4ed6652e68cc04ca3c1010162ef0f..ea1f14328816fbba47ed2b2655438082621eea07 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -36,6 +36,7 @@
#include "SkRandom.h"
#include "SkTransparentShader.h"
#include "SkTypeface.h"
+#include "SkUnitMappers.h"
#include "SkUtils.h"
#include "SkXfermode.h"
@@ -367,8 +368,10 @@
SkScalar* linearPos = NULL;
int linearCount = 2;
SkShader::TileMode linearMode = SkShader::kMirror_TileMode;
+ SkUnitMapper* linearMapper = new SkDiscreteMapper(3);
+ SkAutoUnref unmapLinearMapper(linearMapper);
SkShader* linear = SkGradientShader::CreateLinear(linearPoints,
- linearColors, linearPos, linearCount, linearMode);
+ linearColors, linearPos, linearCount, linearMode, linearMapper);
SkPoint radialCenter = { SkIntToScalar(25), SkIntToScalar(25) };
SkScalar radialRadius = SkIntToScalar(25);
@@ -376,9 +379,11 @@
SkScalar radialPos[] = { 0, SkIntToScalar(3) / 5, SkIntToScalar(1)};
int radialCount = 3;
SkShader::TileMode radialMode = SkShader::kRepeat_TileMode;
+ SkUnitMapper* radialMapper = new SkCosineMapper();
+ SkAutoUnref unmapRadialMapper(radialMapper);
SkShader* radial = SkGradientShader::CreateRadial(radialCenter,
radialRadius, radialColors, radialPos, radialCount,
- radialMode);
+ radialMode, radialMapper);
SkTransparentShader* transparentShader = new SkTransparentShader();
SkEmbossMaskFilter::Light light;
« no previous file with comments | « include/effects/SkGradientShader.h ('k') | samplecode/SampleGradients.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698