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

Side by Side Diff: gm/constcolorprocessor.cpp

Issue 2358433004: Cleanup some sRGB TODOs, mostly around setting GrPaint flags correctly (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | src/core/SkSpecialSurface.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 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // rect to draw 92 // rect to draw
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?
103 SkAssertResult(SkPaintToGrPaint(context, drawContext, skPain t, viewMatrix, 102 SkAssertResult(SkPaintToGrPaint(context, drawContext, skPain t, viewMatrix,
104 &grPaint)); 103 &grPaint));
105 104
106 GrConstColorProcessor::InputMode mode = (GrConstColorProcess or::InputMode) m; 105 GrConstColorProcessor::InputMode mode = (GrConstColorProcess or::InputMode) m;
107 GrColor color = kColors[procColor]; 106 GrColor color = kColors[procColor];
108 sk_sp<GrFragmentProcessor> fp(GrConstColorProcessor::Make(co lor, mode)); 107 sk_sp<GrFragmentProcessor> fp(GrConstColorProcessor::Make(co lor, mode));
109 108
110 grPaint.addColorFragmentProcessor(std::move(fp)); 109 grPaint.addColorFragmentProcessor(std::move(fp));
111 110
112 SkAutoTUnref<GrDrawBatch> batch( 111 SkAutoTUnref<GrDrawBatch> batch(
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 static constexpr int kWidth = 820; 179 static constexpr int kWidth = 820;
181 static constexpr int kHeight = 500; 180 static constexpr int kHeight = 500;
182 181
183 typedef GM INHERITED; 182 typedef GM INHERITED;
184 }; 183 };
185 184
186 DEF_GM(return new ConstColorProcessor;) 185 DEF_GM(return new ConstColorProcessor;)
187 } 186 }
188 187
189 #endif 188 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkSpecialSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698