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

Side by Side Diff: gm/constcolorprocessor.cpp

Issue 1845283003: Gamma-correctness pushed into Skia, top-down. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase 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
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // rect to draw 97 // rect to draw
98 SkRect renderRect = SkRect::MakeXYWH(0, 0, kRectSize, kRectS ize); 98 SkRect renderRect = SkRect::MakeXYWH(0, 0, kRectSize, kRectS ize);
99 99
100 GrPaint grPaint; 100 GrPaint grPaint;
101 SkPaint skPaint; 101 SkPaint skPaint;
102 if (paintType >= SK_ARRAY_COUNT(kPaintColors)) { 102 if (paintType >= SK_ARRAY_COUNT(kPaintColors)) {
103 skPaint.setShader(fShader); 103 skPaint.setShader(fShader);
104 } else { 104 } else {
105 skPaint.setColor(kPaintColors[paintType]); 105 skPaint.setColor(kPaintColors[paintType]);
106 } 106 }
107 SkAssertResult(SkPaintToGrPaint(context, skPaint, viewMatrix , &grPaint)); 107 // SRGBTODO: No sRGB inputs allowed here?
108 SkAssertResult(SkPaintToGrPaint(context, skPaint, viewMatrix , false, &grPaint));
108 109
109 GrConstColorProcessor::InputMode mode = (GrConstColorProcess or::InputMode) m; 110 GrConstColorProcessor::InputMode mode = (GrConstColorProcess or::InputMode) m;
110 GrColor color = kColors[procColor]; 111 GrColor color = kColors[procColor];
111 SkAutoTUnref<GrFragmentProcessor> fp(GrConstColorProcessor:: Create(color, mode)); 112 SkAutoTUnref<GrFragmentProcessor> fp(GrConstColorProcessor:: Create(color, mode));
112 113
113 GrClip clip; 114 GrClip clip;
114 GrPipelineBuilder pipelineBuilder(grPaint, rt, clip); 115 GrPipelineBuilder pipelineBuilder(grPaint, rt, clip);
115 pipelineBuilder.addColorFragmentProcessor(fp); 116 pipelineBuilder.addColorFragmentProcessor(fp);
116 117
117 SkAutoTUnref<GrDrawBatch> batch( 118 SkAutoTUnref<GrDrawBatch> batch(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 typedef GM INHERITED; 189 typedef GM INHERITED;
189 }; 190 };
190 191
191 const SkScalar ConstColorProcessor::kPad = 10.f; 192 const SkScalar ConstColorProcessor::kPad = 10.f;
192 const SkScalar ConstColorProcessor::kRectSize = 20.f; 193 const SkScalar ConstColorProcessor::kRectSize = 20.f;
193 194
194 DEF_GM(return new ConstColorProcessor;) 195 DEF_GM(return new ConstColorProcessor;)
195 } 196 }
196 197
197 #endif 198 #endif
OLDNEW
« no previous file with comments | « dm/DMGpuSupport.h ('k') | gm/dftext.cpp » ('j') | src/effects/SkImageSource.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698