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

Unified Diff: samplecode/SampleFilterFuzz.cpp

Issue 1556553002: Implement an SkPaint-based image filter (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 12 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/SkPaintImageFilter.h ('k') | src/effects/SkPaintImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleFilterFuzz.cpp
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index a0f7aff5ef3ac339d055be7f99d35aef8ed9412a..fc16da24cfdeaffaba73a603e06a773fc43db142 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -23,12 +23,12 @@
#include "SkMergeImageFilter.h"
#include "SkMorphologyImageFilter.h"
#include "SkOffsetImageFilter.h"
+#include "SkPaintImageFilter.h"
#include "SkPerlinNoiseShader.h"
#include "SkPictureImageFilter.h"
#include "SkPictureRecorder.h"
#include "SkPoint3.h"
#include "SkRandom.h"
-#include "SkRectShaderImageFilter.h"
#include "SkTestImageFilters.h"
#include "SkTileImageFilter.h"
#include "SkView.h"
@@ -372,9 +372,11 @@ static SkImageFilter* make_image_filter(bool canBeNull = true) {
make_scalar(true), make_scalar(true), R(10.0f), make_scalar()) :
SkPerlinNoiseShader::CreateTurbulence(
make_scalar(true), make_scalar(true), R(10.0f), make_scalar()));
+ SkPaint paint;
+ paint.setShader(shader);
sugoi1 2016/01/04 16:31:15 You should really try to randomly use all the API
ajuma 2016/01/04 22:39:46 Added a test case below.
SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize),
SkIntToScalar(kBitmapSize)));
- filter = SkRectShaderImageFilter::Create(shader, &cropR);
+ filter = SkPaintImageFilter::Create(paint, &cropR);
}
break;
case DROP_SHADOW:
« no previous file with comments | « include/effects/SkPaintImageFilter.h ('k') | src/effects/SkPaintImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698