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

Side by Side Diff: gm/constcolorprocessor.cpp

Issue 2180503002: Add destination color space to AsFPArgs. Eliminates last XFORMTODO. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 | « experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp ('k') | include/core/SkShader.h » ('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 2015 Google Inc. 2 * Copyright 2015 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 // This test only works with the GPU backend. 8 // This test only works with the GPU backend.
9 9
10 #include "gm.h" 10 #include "gm.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 SkRect renderRect = SkRect::MakeXYWH(0, 0, kRectSize, kRectS ize); 93 SkRect renderRect = SkRect::MakeXYWH(0, 0, kRectSize, kRectS ize);
94 94
95 GrPaint grPaint; 95 GrPaint grPaint;
96 SkPaint skPaint; 96 SkPaint skPaint;
97 if (paintType >= SK_ARRAY_COUNT(kPaintColors)) { 97 if (paintType >= SK_ARRAY_COUNT(kPaintColors)) {
98 skPaint.setShader(fShader); 98 skPaint.setShader(fShader);
99 } else { 99 } else {
100 skPaint.setColor(kPaintColors[paintType]); 100 skPaint.setColor(kPaintColors[paintType]);
101 } 101 }
102 // SRGBTODO: No sRGB inputs allowed here? 102 // SRGBTODO: No sRGB inputs allowed here?
103 SkAssertResult(SkPaintToGrPaint(context, skPaint, viewMatrix , false, &grPaint)); 103 SkAssertResult(SkPaintToGrPaint(context, skPaint, viewMatrix , false, nullptr,
104 &grPaint));
104 105
105 GrConstColorProcessor::InputMode mode = (GrConstColorProcess or::InputMode) m; 106 GrConstColorProcessor::InputMode mode = (GrConstColorProcess or::InputMode) m;
106 GrColor color = kColors[procColor]; 107 GrColor color = kColors[procColor];
107 sk_sp<GrFragmentProcessor> fp(GrConstColorProcessor::Make(co lor, mode)); 108 sk_sp<GrFragmentProcessor> fp(GrConstColorProcessor::Make(co lor, mode));
108 109
109 grPaint.addColorFragmentProcessor(std::move(fp)); 110 grPaint.addColorFragmentProcessor(std::move(fp));
110 111
111 SkAutoTUnref<GrDrawBatch> batch( 112 SkAutoTUnref<GrDrawBatch> batch(
112 GrRectBatchFactory::CreateNonAAFill(grPaint.getColor (), viewMatrix, 113 GrRectBatchFactory::CreateNonAAFill(grPaint.getColor (), viewMatrix,
113 renderRect, null ptr, nullptr)); 114 renderRect, null ptr, nullptr));
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 typedef GM INHERITED; 183 typedef GM INHERITED;
183 }; 184 };
184 185
185 const SkScalar ConstColorProcessor::kPad = 10.f; 186 const SkScalar ConstColorProcessor::kPad = 10.f;
186 const SkScalar ConstColorProcessor::kRectSize = 20.f; 187 const SkScalar ConstColorProcessor::kRectSize = 20.f;
187 188
188 DEF_GM(return new ConstColorProcessor;) 189 DEF_GM(return new ConstColorProcessor;)
189 } 190 }
190 191
191 #endif 192 #endif
OLDNEW
« no previous file with comments | « experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp ('k') | include/core/SkShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698