OLD | NEW |
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 Loading... |
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 //////////////////////////////////////////////////////////////////////////////// |
OLD | NEW |