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

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

Issue 1711223003: Only use fake gamma with linear devices. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Formatting. Created 4 years, 10 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/text/GrAtlasTextBlob.h ('k') | src/gpu/text/GrStencilAndCoverTextContext.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 #include "GrAtlasTextBlob.h" 8 #include "GrAtlasTextBlob.h"
9 9
10 #include "GrBlurUtils.h" 10 #include "GrBlurUtils.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 new (&cacheBlob->fRuns[i]) GrAtlasTextBlob::Run; 44 new (&cacheBlob->fRuns[i]) GrAtlasTextBlob::Run;
45 } 45 }
46 cacheBlob->fRunCount = runCount; 46 cacheBlob->fRunCount = runCount;
47 cacheBlob->fPool = pool; 47 cacheBlob->fPool = pool;
48 return cacheBlob; 48 return cacheBlob;
49 } 49 }
50 50
51 51
52 SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex, 52 SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex,
53 const SkSurfaceProps& props, 53 const SkSurfaceProps& props,
54 SkPaint::FakeGamma fakeGamma,
54 const SkPaint& skPaint, 55 const SkPaint& skPaint,
55 const SkMatrix* viewMatrix, 56 const SkMatrix* viewMatrix) {
56 bool noGamma) {
57 GrAtlasTextBlob::Run* run = &fRuns[runIndex]; 57 GrAtlasTextBlob::Run* run = &fRuns[runIndex];
58 58
59 // if we have an override descriptor for the run, then we should use that 59 // if we have an override descriptor for the run, then we should use that
60 SkAutoDescriptor* desc = run->fOverrideDescriptor.get() ? run->fOverrideDesc riptor.get() : 60 SkAutoDescriptor* desc = run->fOverrideDescriptor.get() ? run->fOverrideDesc riptor.get() :
61 &run->fDescriptor; 61 &run->fDescriptor;
62 skPaint.getScalerContextDescriptor(desc, props, viewMatrix, noGamma); 62 skPaint.getScalerContextDescriptor(desc, props, fakeGamma, viewMatrix);
63 run->fTypeface.reset(SkSafeRef(skPaint.getTypeface())); 63 run->fTypeface.reset(SkSafeRef(skPaint.getTypeface()));
64 return SkGlyphCache::DetachCache(run->fTypeface, desc->getDesc()); 64 return SkGlyphCache::DetachCache(run->fTypeface, desc->getDesc());
65 } 65 }
66 66
67 void GrAtlasTextBlob::appendGlyph(int runIndex, 67 void GrAtlasTextBlob::appendGlyph(int runIndex,
68 const SkRect& positions, 68 const SkRect& positions,
69 GrColor color, 69 GrColor color,
70 GrBatchTextStrike* strike, 70 GrBatchTextStrike* strike,
71 GrGlyph* glyph, 71 GrGlyph* glyph,
72 GrFontScaler* scaler, const SkGlyph& skGlyph, 72 GrFontScaler* scaler, const SkGlyph& skGlyph,
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 SkASSERT_RELEASE(lSubRun.vertexStartIndex() == rSubRun.vertexStartIn dex()); 533 SkASSERT_RELEASE(lSubRun.vertexStartIndex() == rSubRun.vertexStartIn dex());
534 SkASSERT_RELEASE(lSubRun.vertexEndIndex() == rSubRun.vertexEndIndex( )); 534 SkASSERT_RELEASE(lSubRun.vertexEndIndex() == rSubRun.vertexEndIndex( ));
535 SkASSERT_RELEASE(lSubRun.glyphStartIndex() == rSubRun.glyphStartInde x()); 535 SkASSERT_RELEASE(lSubRun.glyphStartIndex() == rSubRun.glyphStartInde x());
536 SkASSERT_RELEASE(lSubRun.glyphEndIndex() == rSubRun.glyphEndIndex()) ; 536 SkASSERT_RELEASE(lSubRun.glyphEndIndex() == rSubRun.glyphEndIndex()) ;
537 SkASSERT_RELEASE(lSubRun.maskFormat() == rSubRun.maskFormat()); 537 SkASSERT_RELEASE(lSubRun.maskFormat() == rSubRun.maskFormat());
538 SkASSERT_RELEASE(lSubRun.drawAsDistanceFields() == rSubRun.drawAsDis tanceFields()); 538 SkASSERT_RELEASE(lSubRun.drawAsDistanceFields() == rSubRun.drawAsDis tanceFields());
539 SkASSERT_RELEASE(lSubRun.hasUseLCDText() == rSubRun.hasUseLCDText()) ; 539 SkASSERT_RELEASE(lSubRun.hasUseLCDText() == rSubRun.hasUseLCDText()) ;
540 } 540 }
541 } 541 }
542 } 542 }
OLDNEW
« no previous file with comments | « src/gpu/text/GrAtlasTextBlob.h ('k') | src/gpu/text/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698