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

Side by Side Diff: src/gpu/text/GrStencilAndCoverTextContext.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 2014 Google Inc. 2 * Copyright 2014 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 "GrStencilAndCoverTextContext.h" 8 #include "GrStencilAndCoverTextContext.h"
9 #include "GrAtlasTextContext.h" 9 #include "GrAtlasTextContext.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ e)) { 159 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ e)) {
160 // A false return from filter() means we should abort the current dr aw. 160 // A false return from filter() means we should abort the current dr aw.
161 runPaint = skPaint; 161 runPaint = skPaint;
162 continue; 162 continue;
163 } 163 }
164 164
165 runPaint.setFlags(GrTextUtils::FilterTextFlags(props, runPaint)); 165 runPaint.setFlags(GrTextUtils::FilterTextFlags(props, runPaint));
166 166
167 GrPaint grPaint; 167 GrPaint grPaint;
168 if (!SkPaintToGrPaint(context, runPaint, viewMatrix, &grPaint)) { 168 if (!SkPaintToGrPaint(context, runPaint, viewMatrix, dc->allowSRGBInputs (), &grPaint)) {
169 return; 169 return;
170 } 170 }
171 171
172 switch (it.positioning()) { 172 switch (it.positioning()) {
173 case SkTextBlob::kDefault_Positioning: 173 case SkTextBlob::kDefault_Positioning:
174 this->drawText(context, dc, clip, grPaint, runPaint, viewMatrix, props, 174 this->drawText(context, dc, clip, grPaint, runPaint, viewMatrix, props,
175 (const char *)it.glyphs(), 175 (const char *)it.glyphs(),
176 textLen, x + offset.x(), y + offset.y(), clipBoun ds); 176 textLen, x + offset.x(), y + offset.y(), clipBoun ds);
177 break; 177 break;
178 case SkTextBlob::kHorizontal_Positioning: 178 case SkTextBlob::kHorizontal_Positioning:
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 213 }
214 214
215 if (drawFilter || skPaint.getPathEffect()) { 215 if (drawFilter || skPaint.getPathEffect()) {
216 // This draw can't be cached. 216 // This draw can't be cached.
217 this->uncachedDrawTextBlob(context, dc, clip, skPaint, viewMatrix, props , skBlob, x, y, 217 this->uncachedDrawTextBlob(context, dc, clip, skPaint, viewMatrix, props , skBlob, x, y,
218 drawFilter, clipBounds); 218 drawFilter, clipBounds);
219 return; 219 return;
220 } 220 }
221 221
222 GrPaint paint; 222 GrPaint paint;
223 if (!SkPaintToGrPaint(context, skPaint, viewMatrix, &paint)) { 223 if (!SkPaintToGrPaint(context, skPaint, viewMatrix, dc->allowSRGBInputs(), & paint)) {
224 return; 224 return;
225 } 225 }
226 226
227 const TextBlob& blob = this->findOrCreateTextBlob(skBlob, skPaint); 227 const TextBlob& blob = this->findOrCreateTextBlob(skBlob, skPaint);
228 GrPipelineBuilder pipelineBuilder(paint, dc->accessRenderTarget(), clip); 228 GrPipelineBuilder pipelineBuilder(paint, dc->accessRenderTarget(), clip);
229 229
230 TextBlob::Iter iter(blob); 230 TextBlob::Iter iter(blob);
231 for (TextRun* run = iter.get(); run; run = iter.next()) { 231 for (TextRun* run = iter.get(); run; run = iter.next()) {
232 run->draw(context, dc, &pipelineBuilder, paint.getColor(), viewMatrix, p rops, x, y, 232 run->draw(context, dc, &pipelineBuilder, paint.getColor(), viewMatrix, p rops, x, y,
233 clipBounds, fFallbackTextContext, skPaint); 233 clipBounds, fFallbackTextContext, skPaint);
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 } 699 }
700 700
701 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed ed(int *count) { 701 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed ed(int *count) {
702 *count = fCount; 702 *count = fCount;
703 if (fCount) { 703 if (fCount) {
704 this->flush(); 704 this->flush();
705 return fBuilder->build(); 705 return fBuilder->build();
706 } 706 }
707 return nullptr; 707 return nullptr;
708 } 708 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698