OLD | NEW |
(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 } |
OLD | NEW |