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

Side by Side Diff: tests/GpuColorFilterTest.cpp

Issue 1873313002: Convert some unit tests from running on GL contexts to running on all contexts (Closed) Base URL: https://skia.googlesource.com/skia.git@vkcfg
Patch Set: Created 4 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
« no previous file with comments | « dm/DM.cpp ('k') | tests/GrDrawTargetTest.cpp » ('j') | 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 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 "SkColorFilter.h" 8 #include "SkColorFilter.h"
9 #include "Test.h" 9 #include "Test.h"
10 10
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 if (flags & kB_GrColorComponentFlag) { 26 if (flags & kB_GrColorComponentFlag) {
27 mask |= 0xFF << GrColor_SHIFT_B; 27 mask |= 0xFF << GrColor_SHIFT_B;
28 } 28 }
29 if (flags & kA_GrColorComponentFlag) { 29 if (flags & kA_GrColorComponentFlag) {
30 mask |= 0xFF << GrColor_SHIFT_A; 30 mask |= 0xFF << GrColor_SHIFT_A;
31 } 31 }
32 return color & mask; 32 return color & mask;
33 } 33 }
34 34
35 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(GpuColorFilter, reporter, ctxInfo) { 35 DEF_GPUTEST_FOR_ALL_CONTEXTS(GpuColorFilter, reporter, ctxInfo) {
36 struct GetConstantComponentTestCase { 36 struct GetConstantComponentTestCase {
37 // "Shape drawn with" 37 // "Shape drawn with"
38 uint32_t inputComponents; // "rgb of", "red of", "alpha of", ... 38 uint32_t inputComponents; // "rgb of", "red of", "alpha of", ...
39 GrColor inputColor; // "[color]" 39 GrColor inputColor; // "[color]"
40 40
41 SkColor filterColor; // "with filter color [color]" 41 SkColor filterColor; // "with filter color [color]"
42 SkXfermode::Mode filterMode; // "in mode [mode]" 42 SkXfermode::Mode filterMode; // "in mode [mode]"
43 43
44 // "produces" 44 // "produces"
45 uint32_t outputComponents; // "rgb of", "red of", "alpha of", ... 45 uint32_t outputComponents; // "rgb of", "red of", "alpha of", ...
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 static_cast<GrColorComponentFlags>(test.inputCom ponents), 105 static_cast<GrColorComponentFlags>(test.inputCom ponents),
106 false); 106 false);
107 fp->computeInvariantOutput(&inout); 107 fp->computeInvariantOutput(&inout);
108 REPORTER_ASSERT(reporter, filterColor(inout.color(), inout.validFlags()) == 108 REPORTER_ASSERT(reporter, filterColor(inout.color(), inout.validFlags()) ==
109 test.outputColor); 109 test.outputColor);
110 REPORTER_ASSERT(reporter, test.outputComponents == inout.validFlags()); 110 REPORTER_ASSERT(reporter, test.outputComponents == inout.validFlags());
111 } 111 }
112 } 112 }
113 113
114 #endif 114 #endif
OLDNEW
« no previous file with comments | « dm/DM.cpp ('k') | tests/GrDrawTargetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698