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

Side by Side Diff: tests/ShaderOpacityTest.cpp

Issue 248033003: Remove support for inheriting the paint color from SkColorShader (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fColor -> color Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkShader.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
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" 8 #include "SkColorShader.h"
9 #include "SkGradientShader.h" 9 #include "SkGradientShader.h"
10 #include "SkShader.h" 10 #include "SkShader.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 97
98 static void test_color(skiatest::Reporter* reporter) 98 static void test_color(skiatest::Reporter* reporter)
99 { 99 {
100 SkColorShader colorShader1(SkColorSetARGB(0,0,0,0)); 100 SkColorShader colorShader1(SkColorSetARGB(0,0,0,0));
101 REPORTER_ASSERT(reporter, !colorShader1.isOpaque()); 101 REPORTER_ASSERT(reporter, !colorShader1.isOpaque());
102 SkColorShader colorShader2(SkColorSetARGB(0xFF,0,0,0)); 102 SkColorShader colorShader2(SkColorSetARGB(0xFF,0,0,0));
103 REPORTER_ASSERT(reporter, colorShader2.isOpaque()); 103 REPORTER_ASSERT(reporter, colorShader2.isOpaque());
104 SkColorShader colorShader3(SkColorSetARGB(0x7F,0,0,0)); 104 SkColorShader colorShader3(SkColorSetARGB(0x7F,0,0,0));
105 REPORTER_ASSERT(reporter, !colorShader3.isOpaque()); 105 REPORTER_ASSERT(reporter, !colorShader3.isOpaque());
106
107 // with inherrited color, shader must declare itself as opaque,
108 // since lack of opacity will depend solely on the paint
109 SkColorShader colorShader4;
110 REPORTER_ASSERT(reporter, colorShader4.isOpaque());
111 } 106 }
112 107
113 DEF_TEST(ShaderOpacity, reporter) { 108 DEF_TEST(ShaderOpacity, reporter) {
114 test_gradient(reporter); 109 test_gradient(reporter);
115 test_color(reporter); 110 test_color(reporter);
116 test_bitmap(reporter); 111 test_bitmap(reporter);
117 } 112 }
OLDNEW
« no previous file with comments | « src/core/SkShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698