OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkColorShader.h" |
| 9 #include "SkGradientShader.h" |
| 10 #include "SkShader.h" |
8 #include "Test.h" | 11 #include "Test.h" |
9 #include "SkShader.h" | |
10 #include "SkGradientShader.h" | |
11 #include "SkColorShader.h" | |
12 | 12 |
13 static void test_bitmap(skiatest::Reporter* reporter) { | 13 static void test_bitmap(skiatest::Reporter* reporter) { |
14 SkBitmap bmp; | 14 SkBitmap bmp; |
15 bmp.setConfig(SkBitmap::kARGB_8888_Config, 2, 2); | 15 bmp.setConfig(SkBitmap::kARGB_8888_Config, 2, 2); |
16 | 16 |
17 // test 1: bitmap without pixel data | 17 // test 1: bitmap without pixel data |
18 SkShader* shader = SkShader::CreateBitmapShader(bmp, | 18 SkShader* shader = SkShader::CreateBitmapShader(bmp, |
19 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode); | 19 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode); |
20 REPORTER_ASSERT(reporter, shader); | 20 REPORTER_ASSERT(reporter, shader); |
21 REPORTER_ASSERT(reporter, !shader->isOpaque()); | 21 REPORTER_ASSERT(reporter, !shader->isOpaque()); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // since lack of opacity will depend solely on the paint | 106 // since lack of opacity will depend solely on the paint |
107 SkColorShader colorShader4; | 107 SkColorShader colorShader4; |
108 REPORTER_ASSERT(reporter, colorShader4.isOpaque()); | 108 REPORTER_ASSERT(reporter, colorShader4.isOpaque()); |
109 } | 109 } |
110 | 110 |
111 DEF_TEST(ShaderOpacity, reporter) { | 111 DEF_TEST(ShaderOpacity, reporter) { |
112 test_gradient(reporter); | 112 test_gradient(reporter); |
113 test_color(reporter); | 113 test_color(reporter); |
114 test_bitmap(reporter); | 114 test_bitmap(reporter); |
115 } | 115 } |
OLD | NEW |