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

Side by Side Diff: tests/GpuColorFilterTest.cpp

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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 | « tests/GLProgramsTest.cpp ('k') | tests/GrPorterDuffTest.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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 { kRGB , gr_whiteTrans, SkColorSetARGB(128, 200, 200, 200), SkXfermode:: kDstOver_Mode, 0 , gr_black}, 92 { kRGB , gr_whiteTrans, SkColorSetARGB(128, 200, 200, 200), SkXfermode:: kDstOver_Mode, 0 , gr_black},
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 GrPaint paint; 98 GrPaint paint;
99 for (size_t i = 0; i < SK_ARRAY_COUNT(filterTests); ++i) { 99 for (size_t i = 0; i < SK_ARRAY_COUNT(filterTests); ++i) {
100 const GetConstantComponentTestCase& test = filterTests[i]; 100 const GetConstantComponentTestCase& test = filterTests[i];
101 auto cf(SkColorFilter::MakeModeFilter(test.filterColor, test.filterMode) ); 101 auto cf(SkColorFilter::MakeModeFilter(test.filterColor, test.filterMode) );
102 SkAutoTUnref<const GrFragmentProcessor> fp( cf->asFragmentProcessor(ctxI nfo.grContext())); 102 sk_sp<GrFragmentProcessor> fp(cf->asFragmentProcessor(ctxInfo.grContext( )));
103 REPORTER_ASSERT(reporter, fp); 103 REPORTER_ASSERT(reporter, fp);
104 GrInvariantOutput inout(test.inputColor, 104 GrInvariantOutput inout(test.inputColor,
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 | « tests/GLProgramsTest.cpp ('k') | tests/GrPorterDuffTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698