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

Side by Side Diff: tests/CachedDecodingPixelRefTest.cpp

Issue 83563002: Implement SkAshmemDiscardableMemory (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: final rebase 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
« no previous file with comments | « src/utils/android/ashmem.h ('k') | tests/DiscardableMemoryTest.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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 SkNEW_ARGS(SkDiscardableMemoryPool, (1, NULL))); 293 SkNEW_ARGS(SkDiscardableMemoryPool, (1, NULL)));
294 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed()); 294 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed());
295 CheckPixelRef(TestImageGenerator::kFailGetPixels_TestType, 295 CheckPixelRef(TestImageGenerator::kFailGetPixels_TestType,
296 reporter, kSkDiscardable_PixelRefType, pool); 296 reporter, kSkDiscardable_PixelRefType, pool);
297 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed()); 297 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed());
298 CheckPixelRef(TestImageGenerator::kSucceedGetPixels_TestType, 298 CheckPixelRef(TestImageGenerator::kSucceedGetPixels_TestType,
299 reporter, kSkDiscardable_PixelRefType, pool); 299 reporter, kSkDiscardable_PixelRefType, pool);
300 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed()); 300 REPORTER_ASSERT(reporter, 0 == pool->getRAMUsed());
301 301
302 SkDiscardableMemoryPool* globalPool = SkGetGlobalDiscardableMemoryPool(); 302 SkDiscardableMemoryPool* globalPool = SkGetGlobalDiscardableMemoryPool();
303 // Only acts differently from NULL on a platform that has a
304 // default discardable memory implementation that differs from the
305 // global DM pool.
303 CheckPixelRef(TestImageGenerator::kFailGetPixels_TestType, 306 CheckPixelRef(TestImageGenerator::kFailGetPixels_TestType,
304 reporter, kSkDiscardable_PixelRefType, globalPool); 307 reporter, kSkDiscardable_PixelRefType, globalPool);
305 CheckPixelRef(TestImageGenerator::kSucceedGetPixels_TestType, 308 CheckPixelRef(TestImageGenerator::kSucceedGetPixels_TestType,
306 reporter, kSkDiscardable_PixelRefType, globalPool); 309 reporter, kSkDiscardable_PixelRefType, globalPool);
307
308 // TODO(halcanary): When ashmem-backed SkDiscardableMemory lands,
309 // test that here (on platforms where it is availible).
310 } 310 }
311 //////////////////////////////////////////////////////////////////////////////// 311 ////////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/utils/android/ashmem.h ('k') | tests/DiscardableMemoryTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698