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

Side by Side Diff: src/gpu/GrPathRenderer.h

Issue 1889453002: Tweak distance field path renderer behavior in gamma-correct mode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebased, plumbed gamma-correctness via DrawPathArgs, fixed typos from most recent change 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
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/batches/GrAADistanceFieldPathRenderer.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 2011 Google Inc. 2 * Copyright 2011 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 #ifndef GrPathRenderer_DEFINED 8 #ifndef GrPathRenderer_DEFINED
9 #define GrPathRenderer_DEFINED 9 #define GrPathRenderer_DEFINED
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 * Args to drawPath() 112 * Args to drawPath()
113 * 113 *
114 * fTarget The target that the path will be rendered to 114 * fTarget The target that the path will be rendered to
115 * fResourceProvider The resource provider for creating gpu resources t o render the path 115 * fResourceProvider The resource provider for creating gpu resources t o render the path
116 * fPipelineBuilder The pipelineBuilder 116 * fPipelineBuilder The pipelineBuilder
117 * fColor Color to render with 117 * fColor Color to render with
118 * fViewMatrix The viewMatrix 118 * fViewMatrix The viewMatrix
119 * fPath the path to draw. 119 * fPath the path to draw.
120 * fStroke the stroke information (width, join, cap) 120 * fStroke the stroke information (width, join, cap)
121 * fAntiAlias true if anti-aliasing is required. 121 * fAntiAlias true if anti-aliasing is required.
122 * fGammaCorrect true if gamma-correct rendering is to be used.
122 */ 123 */
123 struct DrawPathArgs { 124 struct DrawPathArgs {
124 GrDrawTarget* fTarget; 125 GrDrawTarget* fTarget;
125 GrResourceProvider* fResourceProvider; 126 GrResourceProvider* fResourceProvider;
126 GrPipelineBuilder* fPipelineBuilder; 127 GrPipelineBuilder* fPipelineBuilder;
127 GrColor fColor; 128 GrColor fColor;
128 const SkMatrix* fViewMatrix; 129 const SkMatrix* fViewMatrix;
129 const SkPath* fPath; 130 const SkPath* fPath;
130 const GrStrokeInfo* fStroke; 131 const GrStrokeInfo* fStroke;
131 bool fAntiAlias; 132 bool fAntiAlias;
133 bool fGammaCorrect;
132 134
133 void validate() const { 135 void validate() const {
134 SkASSERT(fTarget); 136 SkASSERT(fTarget);
135 SkASSERT(fResourceProvider); 137 SkASSERT(fResourceProvider);
136 SkASSERT(fPipelineBuilder); 138 SkASSERT(fPipelineBuilder);
137 SkASSERT(fViewMatrix); 139 SkASSERT(fViewMatrix);
138 SkASSERT(fPath); 140 SkASSERT(fPath);
139 SkASSERT(fStroke); 141 SkASSERT(fStroke);
140 SkASSERT(!fPath->isEmpty()); 142 SkASSERT(!fPath->isEmpty());
141 } 143 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 args.fPipelineBuilder->setDisableColorXPFactory(); 276 args.fPipelineBuilder->setDisableColorXPFactory();
275 DrawPathArgs drawArgs; 277 DrawPathArgs drawArgs;
276 drawArgs.fTarget = args.fTarget; 278 drawArgs.fTarget = args.fTarget;
277 drawArgs.fResourceProvider = args.fResourceProvider; 279 drawArgs.fResourceProvider = args.fResourceProvider;
278 drawArgs.fPipelineBuilder = args.fPipelineBuilder; 280 drawArgs.fPipelineBuilder = args.fPipelineBuilder;
279 drawArgs.fColor = 0xFFFFFFFF; 281 drawArgs.fColor = 0xFFFFFFFF;
280 drawArgs.fViewMatrix = args.fViewMatrix; 282 drawArgs.fViewMatrix = args.fViewMatrix;
281 drawArgs.fPath = args.fPath; 283 drawArgs.fPath = args.fPath;
282 drawArgs.fStroke = args.fStroke; 284 drawArgs.fStroke = args.fStroke;
283 drawArgs.fAntiAlias = false; 285 drawArgs.fAntiAlias = false;
286 drawArgs.fGammaCorrect = false;
284 this->drawPath(drawArgs); 287 this->drawPath(drawArgs);
285 } 288 }
286 289
287 290
288 typedef SkRefCnt INHERITED; 291 typedef SkRefCnt INHERITED;
289 }; 292 };
290 293
291 #endif 294 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/batches/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698