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

Unified Diff: gm/imagefiltersscaled.cpp

Issue 1556553002: Implement an SkPaint-based image filter (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: More randomness for paths and for rasterizer's paint Created 4 years, 11 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: gm/imagefiltersscaled.cpp
diff --git a/gm/imagefiltersscaled.cpp b/gm/imagefiltersscaled.cpp
index 3221c88cae87a194dfbcc617c5f74f5540a40081..7576ee1375edc213f5dc5372d906725b3d0c7f7f 100644
--- a/gm/imagefiltersscaled.cpp
+++ b/gm/imagefiltersscaled.cpp
@@ -16,9 +16,9 @@
#include "SkLightingImageFilter.h"
#include "SkMorphologyImageFilter.h"
#include "SkOffsetImageFilter.h"
+#include "SkPaintImageFilter.h"
#include "SkPerlinNoiseShader.h"
#include "SkPoint3.h"
-#include "SkRectShaderImageFilter.h"
#include "SkScalar.h"
#include "SkSurface.h"
#include "gm.h"
@@ -56,6 +56,8 @@ protected:
SkAutoTUnref<SkImageFilter> checkerboard(SkImageSource::Create(fCheckerboard));
SkAutoTUnref<SkShader> noise(SkPerlinNoiseShader::CreateFractalNoise(
SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0));
+ SkPaint noisePaint;
+ noisePaint.setShader(noise);
SkPoint3 pointLocation = SkPoint3::Make(0, 0, SkIntToScalar(10));
SkPoint3 spotLocation = SkPoint3::Make(SkIntToScalar(-10),
@@ -84,7 +86,7 @@ protected:
SkErodeImageFilter::Create(1, 1, checkerboard.get()),
SkOffsetImageFilter::Create(SkIntToScalar(32), 0),
SkImageFilter::CreateMatrixFilter(resizeMatrix, kNone_SkFilterQuality),
- SkRectShaderImageFilter::Create(noise),
+ SkPaintImageFilter::Create(noisePaint),
SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, white, surfaceScale, kd),
SkLightingImageFilter::CreateSpotLitDiffuse(spotLocation, spotTarget, spotExponent,
cutoffAngle, white, surfaceScale, kd),
« no previous file with comments | « gm/imagefiltersclipped.cpp ('k') | gyp/effects.gypi » ('j') | samplecode/SampleFilterFuzz.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698