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 | 9 |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 * This test contains basic sanity checks concerning bitmaps. | 68 * This test contains basic sanity checks concerning bitmaps. |
69 */ | 69 */ |
70 DEF_TEST(Bitmap, reporter) { | 70 DEF_TEST(Bitmap, reporter) { |
71 // Zero-sized bitmaps are allowed | 71 // Zero-sized bitmaps are allowed |
72 for (int width = 0; width < 2; ++width) { | 72 for (int width = 0; width < 2; ++width) { |
73 for (int height = 0; height < 2; ++height) { | 73 for (int height = 0; height < 2; ++height) { |
74 SkBitmap bm; | 74 SkBitmap bm; |
75 bool setConf = bm.setInfo(SkImageInfo::MakeN32Premul(width, height))
; | 75 bool setConf = bm.setInfo(SkImageInfo::MakeN32Premul(width, height))
; |
76 REPORTER_ASSERT(reporter, setConf); | 76 REPORTER_ASSERT(reporter, setConf); |
77 if (setConf) { | 77 if (setConf) { |
78 REPORTER_ASSERT(reporter, bm.allocPixels(NULL)); | 78 bm.allocPixels(); |
79 } | 79 } |
80 REPORTER_ASSERT(reporter, SkToBool(width & height) != bm.empty()); | 80 REPORTER_ASSERT(reporter, SkToBool(width & height) != bm.empty()); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 test_bigwidth(reporter); | 84 test_bigwidth(reporter); |
85 test_allocpixels(reporter); | 85 test_allocpixels(reporter); |
86 } | 86 } |
OLD | NEW |