aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2015-09-15 11:26:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-15 11:26:14 -0700
commit5598b63cd2443a608a74a222d0206bb2455383b7 (patch)
tree1e661b0510b7deeadea831d5288989598a66a3a8 /samplecode
parent30c4cae7d3a26252e7e45adf6e5722b34adf6848 (diff)
Convert unit tests, GMs from SkBitmapSource to SkImagesource
This removes SkBitmapSource clients within Skia. http://crrev.com/1334173004 does the same for Blink, so we should be able to remove SkBitmapSource in a follow-up. R=reed@google.com,robertphillips@google.com,mtklein@google.com Review URL: https://codereview.chromium.org/1343123002
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleFilterFuzz.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index ca4b8e2db3..9973d3762a 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(),