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

Side by Side Diff: tests/CachedDecodingPixelRefTest.cpp

Issue 93703004: Change SkDecodingImageGenerator API (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 } 140 }
141 bool comparePixels = (SkImageEncoder::kPNG_Type == type); 141 bool comparePixels = (SkImageEncoder::kPNG_Type == type);
142 compare_bitmaps(reporter, original, lazy, comparePixels); 142 compare_bitmaps(reporter, original, lazy, comparePixels);
143 } 143 }
144 } 144 }
145 145
146 //////////////////////////////////////////////////////////////////////////////// 146 ////////////////////////////////////////////////////////////////////////////////
147 static bool install_skCachingPixelRef(SkData* encoded, SkBitmap* dst) { 147 static bool install_skCachingPixelRef(SkData* encoded, SkBitmap* dst) {
148 return SkCachingPixelRef::Install( 148 return SkCachingPixelRef::Install(
149 SkNEW_ARGS(SkDecodingImageGenerator, (encoded)), dst); 149 SkNEW_ARGS(SkDecodingImageGenerator, (encoded, NULL)), dst);
150 } 150 }
151 static bool install_skDiscardablePixelRef(SkData* encoded, SkBitmap* dst) { 151 static bool install_skDiscardablePixelRef(SkData* encoded, SkBitmap* dst) {
152 // Use system-default discardable memory. 152 // Use system-default discardable memory.
153 return SkDecodingImageGenerator::Install(encoded, dst, NULL); 153 return SkDecodingImageGenerator::Install(encoded, dst, NULL, NULL);
154 } 154 }
155 155
156 //////////////////////////////////////////////////////////////////////////////// 156 ////////////////////////////////////////////////////////////////////////////////
157 /** 157 /**
158 * This checks to see that a SkCachingPixelRef and a 158 * This checks to see that a SkCachingPixelRef and a
159 * SkDiscardablePixelRef works as advertised with a 159 * SkDiscardablePixelRef works as advertised with a
160 * SkDecodingImageGenerator. 160 * SkDecodingImageGenerator.
161 */ 161 */
162 DEF_TEST(DecodingImageGenerator, reporter) { 162 DEF_TEST(DecodingImageGenerator, reporter) {
163 test_three_encodings(reporter, install_skCachingPixelRef); 163 test_three_encodings(reporter, install_skCachingPixelRef);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 SkDiscardableMemoryPool* globalPool = SkGetGlobalDiscardableMemoryPool(); 301 SkDiscardableMemoryPool* globalPool = SkGetGlobalDiscardableMemoryPool();
302 // Only acts differently from NULL on a platform that has a 302 // Only acts differently from NULL on a platform that has a
303 // default discardable memory implementation that differs from the 303 // default discardable memory implementation that differs from the
304 // global DM pool. 304 // global DM pool.
305 CheckPixelRef(TestImageGenerator::kFailGetPixels_TestType, 305 CheckPixelRef(TestImageGenerator::kFailGetPixels_TestType,
306 reporter, kSkDiscardable_PixelRefType, globalPool); 306 reporter, kSkDiscardable_PixelRefType, globalPool);
307 CheckPixelRef(TestImageGenerator::kSucceedGetPixels_TestType, 307 CheckPixelRef(TestImageGenerator::kSucceedGetPixels_TestType,
308 reporter, kSkDiscardable_PixelRefType, globalPool); 308 reporter, kSkDiscardable_PixelRefType, globalPool);
309 } 309 }
310 //////////////////////////////////////////////////////////////////////////////// 310 ////////////////////////////////////////////////////////////////////////////////
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698