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