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

Side by Side Diff: tests/CachedDecodingPixelRefTest.cpp

Issue 223403012: SkDiscardableMemoryPool to abstract class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: AnotherPatchSet Created 6 years, 8 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
« no previous file with comments | « src/lazy/SkDiscardableMemoryPool.cpp ('k') | tests/DiscardableMemoryPoolTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "SkCachingPixelRef.h" 9 #include "SkCachingPixelRef.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 reporter, kSkCaching_PixelRefType, NULL); 296 reporter, kSkCaching_PixelRefType, NULL);
297 297
298 check_pixelref(TestImageGenerator::kFailGetInfo_TestType, 298 check_pixelref(TestImageGenerator::kFailGetInfo_TestType,
299 reporter, kSkDiscardable_PixelRefType, NULL); 299 reporter, kSkDiscardable_PixelRefType, NULL);
300 check_pixelref(TestImageGenerator::kFailGetPixels_TestType, 300 check_pixelref(TestImageGenerator::kFailGetPixels_TestType,
301 reporter, kSkDiscardable_PixelRefType, NULL); 301 reporter, kSkDiscardable_PixelRefType, NULL);
302 check_pixelref(TestImageGenerator::kSucceedGetPixels_TestType, 302 check_pixelref(TestImageGenerator::kSucceedGetPixels_TestType,
303 reporter, kSkDiscardable_PixelRefType, NULL); 303 reporter, kSkDiscardable_PixelRefType, NULL);
304 304
305 SkAutoTUnref<SkDiscardableMemoryPool> pool( 305 SkAutoTUnref<SkDiscardableMemoryPool> pool(
306 SkNEW_ARGS(SkDiscardableMemoryPool, (1, NULL))); 306 SkDiscardableMemoryPool::Create(1, NULL));
307 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed()); 307 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed());
308 check_pixelref(TestImageGenerator::kFailGetPixels_TestType, 308 check_pixelref(TestImageGenerator::kFailGetPixels_TestType,
309 reporter, kSkDiscardable_PixelRefType, pool); 309 reporter, kSkDiscardable_PixelRefType, pool);
310 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed()); 310 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed());
311 check_pixelref(TestImageGenerator::kSucceedGetPixels_TestType, 311 check_pixelref(TestImageGenerator::kSucceedGetPixels_TestType,
312 reporter, kSkDiscardable_PixelRefType, pool); 312 reporter, kSkDiscardable_PixelRefType, pool);
313 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed()); 313 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed());
314 314
315 SkDiscardableMemoryPool* globalPool = SkGetGlobalDiscardableMemoryPool(); 315 SkDiscardableMemoryPool* globalPool = SkGetGlobalDiscardableMemoryPool();
316 // Only acts differently from NULL on a platform that has a 316 // Only acts differently from NULL on a platform that has a
317 // default discardable memory implementation that differs from the 317 // default discardable memory implementation that differs from the
318 // global DM pool. 318 // global DM pool.
319 check_pixelref(TestImageGenerator::kFailGetPixels_TestType, 319 check_pixelref(TestImageGenerator::kFailGetPixels_TestType,
320 reporter, kSkDiscardable_PixelRefType, globalPool); 320 reporter, kSkDiscardable_PixelRefType, globalPool);
321 check_pixelref(TestImageGenerator::kSucceedGetPixels_TestType, 321 check_pixelref(TestImageGenerator::kSucceedGetPixels_TestType,
322 reporter, kSkDiscardable_PixelRefType, globalPool); 322 reporter, kSkDiscardable_PixelRefType, globalPool);
323 } 323 }
OLDNEW
« no previous file with comments | « src/lazy/SkDiscardableMemoryPool.cpp ('k') | tests/DiscardableMemoryPoolTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698