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

Side by Side Diff: tests/GpuColorFilterTest.cpp

Issue 643743003: Create helper functions to use in computeInvariantOutput calls (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update blurMaskFilter Created 6 years, 2 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 | « src/gpu/effects/GrYUVtoRGBEffect.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 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 // An unknown color with known alpha and red component filtered with Mul tiply produces an unknown color with known red and alpha. 94 // An unknown color with known alpha and red component filtered with Mul tiply produces an unknown color with known red and alpha.
95 { kR|kA , gr_whiteTrans, SkColorSetARGB(128, 200, 200, 200), SkXfermode: :kModulate_Mode, kR|kA, GrColorPackRGBA(50, 0, 0, 64) } 95 { kR|kA , gr_whiteTrans, SkColorSetARGB(128, 200, 200, 200), SkXfermode: :kModulate_Mode, kR|kA, GrColorPackRGBA(50, 0, 0, 64) }
96 }; 96 };
97 97
98 for (size_t i = 0; i < SK_ARRAY_COUNT(filterTests); ++i) { 98 for (size_t i = 0; i < SK_ARRAY_COUNT(filterTests); ++i) {
99 const GetConstantComponentTestCase& test = filterTests[i]; 99 const GetConstantComponentTestCase& test = filterTests[i];
100 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(test.filt erColor, test.filterMode)); 100 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(test.filt erColor, test.filterMode));
101 SkAutoTUnref<GrFragmentProcessor> effect(cf->asFragmentProcessor(grConte xt)); 101 SkAutoTUnref<GrFragmentProcessor> effect(cf->asFragmentProcessor(grConte xt));
102 GrProcessor::InvariantOutput inout; 102 GrProcessor::InvariantOutput inout;
103 inout.fColor = test.inputColor; 103 inout.setToOther(test.inputComponents, test.inputColor);
104 inout.fValidFlags = test.inputComponents;
105 inout.fIsSingleComponent = false;
106 effect->computeInvariantOutput(&inout); 104 effect->computeInvariantOutput(&inout);
107 105
108 REPORTER_ASSERT(reporter, filterColor(inout.fColor, inout.fValidFlags) = = test.outputColor); 106 REPORTER_ASSERT(reporter, filterColor(inout.color(), inout.validFlags()) == test.outputColor);
109 REPORTER_ASSERT(reporter, test.outputComponents == inout.fValidFlags); 107 REPORTER_ASSERT(reporter, test.outputComponents == inout.validFlags());
110 } 108 }
111 } 109 }
112 110
113 DEF_GPUTEST(GpuColorFilter, reporter, factory) { 111 DEF_GPUTEST(GpuColorFilter, reporter, factory) {
114 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { 112 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
115 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::G LContextType>(type); 113 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::G LContextType>(type);
116 114
117 GrContext* grContext = factory->get(glType); 115 GrContext* grContext = factory->get(glType);
118 if (NULL == grContext) { 116 if (NULL == grContext) {
119 continue; 117 continue;
120 } 118 }
121 119
122 test_getConstantColorComponents(reporter, grContext); 120 test_getConstantColorComponents(reporter, grContext);
123 } 121 }
124 } 122 }
125 123
126 #endif 124 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrYUVtoRGBEffect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698