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

Side by Side Diff: tests/BitmapTest.cpp

Issue 111953004: Allow 0-width SkBitmap in setConfig. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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/core/SkBitmap.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkBitmap.h"
9
10 #include "Test.h"
11 #include "TestClassDef.h"
12
13 /**
14 * This test contains basic sanity checks concerning bitmaps.
15 */
16 DEF_TEST(Bitmap, reporter) {
17 const SkBitmap::Config conf = SkBitmap::kARGB_8888_Config;
18 // Zero-sized bitmaps are allowed
19 for (int width = 0; width < 2; ++width) {
20 for (int height = 0; height < 2; ++height) {
21 SkBitmap bm;
22 bool setConf = bm.setConfig(conf, width, height);
23 REPORTER_ASSERT(reporter, setConf);
24 if (setConf) {
25 REPORTER_ASSERT(reporter, bm.allocPixels(NULL));
26 }
27 REPORTER_ASSERT(reporter, (width & height) != bm.empty());
28 }
29 }
30 }
OLDNEW
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698