diff options
author | 2014-05-22 02:55:59 +0000 | |
---|---|---|
committer | 2014-05-22 02:55:59 +0000 | |
commit | 3339ac54a5ed75f2872ab16e9052a8b9ff3564bf (patch) | |
tree | 42852098db6117ad0f15cf332bc2aacffa322e38 /samplecode/SampleAll.cpp | |
parent | 8991c67f0c1b9364bb12dfb0f32a53bd5a3357f3 (diff) |
Revert of Remove unused (by clients) SkUnitMapper (https://codereview.chromium.org/283273002/) (https://codereview.chromium.org/288343009/)
Reason for revert:
required blink change failed to land
Original issue's description:
> Remove unused (by clients) SkUnitMapper (https://codereview.chromium.org/283273002/)
>
> This reverts commit dd50c83b5b34dab3a077741861b50ed1f2bc6b8f.
>
> BUG=skia:
>
> Committed: http://code.google.com/p/skia/source/detail?r=14830
R=scroggo@google.com, reed@google.com
TBR=reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Author: reed@chromium.org
Review URL: https://codereview.chromium.org/296823008
git-svn-id: http://skia.googlecode.com/svn/trunk@14838 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleAll.cpp')
-rw-r--r-- | samplecode/SampleAll.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp index 92fe258dd6..ea1f143288 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 @@ protected: 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 @@ protected: 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; |