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

Unified Diff: tests/SerializationTest.cpp

Issue 182983003: Factory methods for heap-allocated SkImageFilter objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 6 years, 9 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 | « tests/ImageFilterTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SerializationTest.cpp
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index 95067298d03c05c8f1616211bcc32e31f12268c4..7b2914a1cbeac8eed286836ce15152b577d11a96 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -205,14 +205,15 @@ static void TestBitmapSerialization(const SkBitmap& validBitmap,
const SkBitmap& invalidBitmap,
bool shouldSucceed,
skiatest::Reporter* reporter) {
- SkBitmapSource validBitmapSource(validBitmap);
- SkBitmapSource invalidBitmapSource(invalidBitmap);
+ SkAutoTUnref<SkBitmapSource> validBitmapSource(SkBitmapSource::Create(validBitmap));
+ SkAutoTUnref<SkBitmapSource> invalidBitmapSource(SkBitmapSource::Create(invalidBitmap));
SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(SkXfermode::kSrcOver_Mode));
- SkXfermodeImageFilter xfermodeImageFilter(mode, &invalidBitmapSource, &validBitmapSource);
+ SkAutoTUnref<SkXfermodeImageFilter> xfermodeImageFilter(
+ SkXfermodeImageFilter::Create(mode, invalidBitmapSource, validBitmapSource));
SkAutoTUnref<SkImageFilter> deserializedFilter(
TestFlattenableSerialization<SkImageFilter>(
- &xfermodeImageFilter, shouldSucceed, reporter));
+ xfermodeImageFilter, shouldSucceed, reporter));
// Try to render a small bitmap using the invalid deserialized filter
// to make sure we don't crash while trying to render it
« no previous file with comments | « tests/ImageFilterTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698