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

Side by Side Diff: tests/CachedDecodingPixelRefTest.cpp

Issue 2206633004: Move off SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gotta catch 'em all. Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if (original.empty() || original.isNull()) { 100 if (original.empty() || original.isNull()) {
101 return; 101 return;
102 } 102 }
103 static const SkImageEncoder::Type types[] = { 103 static const SkImageEncoder::Type types[] = {
104 SkImageEncoder::kPNG_Type, 104 SkImageEncoder::kPNG_Type,
105 SkImageEncoder::kJPEG_Type, 105 SkImageEncoder::kJPEG_Type,
106 SkImageEncoder::kWEBP_Type 106 SkImageEncoder::kWEBP_Type
107 }; 107 };
108 for (size_t i = 0; i < SK_ARRAY_COUNT(types); i++) { 108 for (size_t i = 0; i < SK_ARRAY_COUNT(types); i++) {
109 SkImageEncoder::Type type = types[i]; 109 SkImageEncoder::Type type = types[i];
110 SkAutoDataUnref encoded(create_data_from_bitmap(original, type)); 110 sk_sp<SkData> encoded(create_data_from_bitmap(original, type));
111 REPORTER_ASSERT(reporter, encoded.get() != nullptr); 111 REPORTER_ASSERT(reporter, encoded.get() != nullptr);
112 if (nullptr == encoded.get()) { 112 if (nullptr == encoded.get()) {
113 continue; 113 continue;
114 } 114 }
115 SkBitmap lazy; 115 SkBitmap lazy;
116 bool installSuccess = install(encoded.get(), &lazy); 116 bool installSuccess = install(encoded.get(), &lazy);
117 REPORTER_ASSERT(reporter, installSuccess); 117 REPORTER_ASSERT(reporter, installSuccess);
118 if (!installSuccess) { 118 if (!installSuccess) {
119 continue; 119 continue;
120 } 120 }
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 if (TestImageGenerator::kSucceedGetPixels_TestType == test) { 339 if (TestImageGenerator::kSucceedGetPixels_TestType == test) {
340 REPORTER_ASSERT( 340 REPORTER_ASSERT(
341 r, TestImageGenerator::Color() == bitmap.getColor(0, 0)); 341 r, TestImageGenerator::Color() == bitmap.getColor(0, 0));
342 } 342 }
343 else { 343 else {
344 REPORTER_ASSERT(r, kDefaultColor == bitmap.getColor(0, 0)); 344 REPORTER_ASSERT(r, kDefaultColor == bitmap.getColor(0, 0));
345 } 345 }
346 } 346 }
347 } 347 }
348 } 348 }
OLDNEW
« include/core/SkData.h ('K') | « tests/AnnotationTest.cpp ('k') | tests/CodecPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698