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

Unified Diff: samplecode/SampleFilterFuzz.cpp

Issue 1343123002: Convert unit tests, GMs from SkBitmapSource to SkImagesource (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: review comments Created 5 years, 3 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/xfermodeimagefilter.cpp ('k') | tests/ImageFilterTest.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 ca4b8e2db3c9fa0d6eb4f259ee114eee0c79e0e1..9973d3762a4090319a39bcc8755ac26730385200 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -6,7 +6,6 @@
*/
#include "SampleCode.h"
#include "SkAlphaThresholdFilter.h"
-#include "SkBitmapSource.h"
#include "SkBlurImageFilter.h"
#include "SkCanvas.h"
#include "SkColorCubeFilter.h"
@@ -17,6 +16,7 @@
#include "SkDisplacementMapEffect.h"
#include "SkDropShadowImageFilter.h"
#include "SkFlattenableSerialization.h"
+#include "SkImageSource.h"
#include "SkLightingImageFilter.h"
#include "SkMagnifierImageFilter.h"
#include "SkMatrixConvolutionImageFilter.h"
@@ -392,11 +392,14 @@ static SkImageFilter* make_image_filter(bool canBeNull = true) {
}
break;
case BITMAP:
+ {
+ SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(make_bitmap()));
if (R(2) == 1) {
- filter = SkBitmapSource::Create(make_bitmap(), make_rect(), make_rect());
+ filter = SkImageSource::Create(image, make_rect(), make_rect(), kHigh_SkFilterQuality);
} else {
- filter = SkBitmapSource::Create(make_bitmap());
+ filter = SkImageSource::Create(image);
}
+ }
break;
case DISPLACE:
filter = SkDisplacementMapEffect::Create(make_channel_selector_type(),
« no previous file with comments | « gm/xfermodeimagefilter.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698