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

Side by Side Diff: tests/CachedDecodingPixelRefTest.cpp

Issue 322963002: hide SkBitmap::setConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « tests/ARGBImageEncoderTest.cpp ('k') | tests/KtxTest.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"
11 #include "SkData.h" 11 #include "SkData.h"
12 #include "SkDecodingImageGenerator.h" 12 #include "SkDecodingImageGenerator.h"
13 #include "SkDiscardableMemoryPool.h" 13 #include "SkDiscardableMemoryPool.h"
14 #include "SkImageDecoder.h" 14 #include "SkImageDecoder.h"
15 #include "SkImageGeneratorPriv.h" 15 #include "SkImageGeneratorPriv.h"
16 #include "SkScaledImageCache.h" 16 #include "SkScaledImageCache.h"
17 #include "SkStream.h" 17 #include "SkStream.h"
18 #include "SkUtils.h" 18 #include "SkUtils.h"
19 19
20 #include "Test.h" 20 #include "Test.h"
21 21
22 /** 22 /**
23 * Fill this bitmap with some color. 23 * Fill this bitmap with some color.
24 */ 24 */
25 static void make_test_image(SkBitmap* bm) { 25 static void make_test_image(SkBitmap* bm) {
26 static const int W = 50, H = 50; 26 const int W = 50, H = 50;
27 static const SkBitmap::Config config = SkBitmap::kARGB_8888_Config; 27 bm->allocN32Pixels(W, H);
28 bm->setConfig(config, W, H);
29 bm->allocPixels();
30 bm->eraseColor(SK_ColorBLACK); 28 bm->eraseColor(SK_ColorBLACK);
31 SkCanvas canvas(*bm); 29 SkCanvas canvas(*bm);
32 SkPaint paint; 30 SkPaint paint;
33 paint.setColor(SK_ColorBLUE); 31 paint.setColor(SK_ColorBLUE);
34 canvas.drawRectCoords(0, 0, SkIntToScalar(W/2), 32 canvas.drawRectCoords(0, 0, SkIntToScalar(W/2),
35 SkIntToScalar(H/2), paint); 33 SkIntToScalar(H/2), paint);
36 paint.setColor(SK_ColorWHITE); 34 paint.setColor(SK_ColorWHITE);
37 canvas.drawRectCoords(SkIntToScalar(W/2), SkIntToScalar(H/2), 35 canvas.drawRectCoords(SkIntToScalar(W/2), SkIntToScalar(H/2),
38 SkIntToScalar(W), SkIntToScalar(H), paint); 36 SkIntToScalar(W), SkIntToScalar(H), paint);
39 } 37 }
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 315
318 SkDiscardableMemoryPool* globalPool = SkGetGlobalDiscardableMemoryPool(); 316 SkDiscardableMemoryPool* globalPool = SkGetGlobalDiscardableMemoryPool();
319 // Only acts differently from NULL on a platform that has a 317 // Only acts differently from NULL on a platform that has a
320 // default discardable memory implementation that differs from the 318 // default discardable memory implementation that differs from the
321 // global DM pool. 319 // global DM pool.
322 check_pixelref(TestImageGenerator::kFailGetPixels_TestType, 320 check_pixelref(TestImageGenerator::kFailGetPixels_TestType,
323 reporter, kSkDiscardable_PixelRefType, globalPool); 321 reporter, kSkDiscardable_PixelRefType, globalPool);
324 check_pixelref(TestImageGenerator::kSucceedGetPixels_TestType, 322 check_pixelref(TestImageGenerator::kSucceedGetPixels_TestType,
325 reporter, kSkDiscardable_PixelRefType, globalPool); 323 reporter, kSkDiscardable_PixelRefType, globalPool);
326 } 324 }
OLDNEW
« no previous file with comments | « tests/ARGBImageEncoderTest.cpp ('k') | tests/KtxTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698