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

Side by Side Diff: src/gpu/text/GrAtlasTextBlob.cpp

Issue 1888473003: Simplify gamma-correctness for text rendering. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « no previous file | src/gpu/text/GrAtlasTextContext.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 #include "GrAtlasTextBlob.h" 8 #include "GrAtlasTextBlob.h"
9 9
10 #include "GrBlurUtils.h" 10 #include "GrBlurUtils.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 const SkPaint& skPaint, const SkSurfaceProps& pro ps, 305 const SkPaint& skPaint, const SkSurfaceProps& pro ps,
306 const GrDistanceFieldAdjustTable* distanceAdjustT able, 306 const GrDistanceFieldAdjustTable* distanceAdjustT able,
307 GrBatchFontCache* cache) { 307 GrBatchFontCache* cache) {
308 for (int subRun = 0; subRun < fRuns[run].fSubRunInfo.count(); subRun++) { 308 for (int subRun = 0; subRun < fRuns[run].fSubRunInfo.count(); subRun++) {
309 const Run::SubRunInfo& info = fRuns[run].fSubRunInfo[subRun]; 309 const Run::SubRunInfo& info = fRuns[run].fSubRunInfo[subRun];
310 int glyphCount = info.glyphCount(); 310 int glyphCount = info.glyphCount();
311 if (0 == glyphCount) { 311 if (0 == glyphCount) {
312 continue; 312 continue;
313 } 313 }
314 314
315 bool useGammaCorrectTable = GrPixelConfigIsSRGB(dc->accessRenderTarget() ->config()) &&
316 !pipelineBuilder->getDisableOutputConversion ToSRGB();
317
318 SkAutoTUnref<GrDrawBatch> batch(this->createBatch(info, glyphCount, run, 315 SkAutoTUnref<GrDrawBatch> batch(this->createBatch(info, glyphCount, run,
319 subRun, viewMatrix, x, y, color, 316 subRun, viewMatrix, x, y, color,
320 skPaint, props, 317 skPaint, props,
321 distanceAdjustTable, u seGammaCorrectTable, 318 distanceAdjustTable, d c->isGammaCorrect(),
322 cache)); 319 cache));
323 dc->drawBatch(pipelineBuilder, batch); 320 dc->drawBatch(pipelineBuilder, batch);
324 } 321 }
325 } 322 }
326 323
327 static void calculate_translation(bool applyVM, 324 static void calculate_translation(bool applyVM,
328 const SkMatrix& newViewMatrix, SkScalar newX, SkScalar newY, 325 const SkMatrix& newViewMatrix, SkScalar newX, SkScalar newY,
329 const SkMatrix& currentViewMatrix, SkScalar cu rrentX, 326 const SkMatrix& currentViewMatrix, SkScalar cu rrentX,
330 SkScalar currentY, SkScalar* transX, SkScalar* transY) { 327 SkScalar currentY, SkScalar* transX, SkScalar* transY) {
331 if (applyVM) { 328 if (applyVM) {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 557
561 void GrAtlasTextBlob::Run::SubRunInfo::computeTranslation(const SkMatrix& viewMa trix, 558 void GrAtlasTextBlob::Run::SubRunInfo::computeTranslation(const SkMatrix& viewMa trix,
562 SkScalar x, SkScalar y , SkScalar* transX, 559 SkScalar x, SkScalar y , SkScalar* transX,
563 SkScalar* transY) { 560 SkScalar* transY) {
564 calculate_translation(!this->drawAsDistanceFields(), viewMatrix, x, y, 561 calculate_translation(!this->drawAsDistanceFields(), viewMatrix, x, y,
565 fCurrentViewMatrix, fX, fY, transX, transY); 562 fCurrentViewMatrix, fX, fY, transX, transY);
566 fCurrentViewMatrix = viewMatrix; 563 fCurrentViewMatrix = viewMatrix;
567 fX = x; 564 fX = x;
568 fY = y; 565 fY = y;
569 } 566 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/text/GrAtlasTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698