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

Side by Side Diff: src/gpu/text/GrAtlasTextContext.h

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 | « src/gpu/text/GrAtlasTextBlob.cpp ('k') | src/gpu/text/GrAtlasTextContext.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 #ifndef GrAtlasTextContext_DEFINED 8 #ifndef GrAtlasTextContext_DEFINED
9 #define GrAtlasTextContext_DEFINED 9 #define GrAtlasTextContext_DEFINED
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 const SkMatrix& viewMatrix, const SkSurfaceProps&, const S kTextBlob*, 46 const SkMatrix& viewMatrix, const SkSurfaceProps&, const S kTextBlob*,
47 SkScalar x, SkScalar y, 47 SkScalar x, SkScalar y,
48 SkDrawFilter*, const SkIRect& clipBounds); 48 SkDrawFilter*, const SkIRect& clipBounds);
49 49
50 private: 50 private:
51 GrAtlasTextContext(); 51 GrAtlasTextContext();
52 52
53 // sets up the descriptor on the blob and returns a detached cache. Client must attach 53 // sets up the descriptor on the blob and returns a detached cache. Client must attach
54 inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd); 54 inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd);
55 // Determines if we need to use fake gamma (and contrast boost): 55 // Determines if we need to use fake gamma (and contrast boost):
56 inline static uint32_t ComputeScalerContextFlags(GrDrawContext*, const GrPai nt&); 56 inline static uint32_t ComputeScalerContextFlags(GrDrawContext*);
57 static void RegenerateTextBlob(GrAtlasTextBlob* bmp, 57 static void RegenerateTextBlob(GrAtlasTextBlob* bmp,
58 GrBatchFontCache*, 58 GrBatchFontCache*,
59 const GrShaderCaps&, 59 const GrShaderCaps&,
60 const SkPaint& skPaint, GrColor, 60 const SkPaint& skPaint, GrColor,
61 uint32_t scalerContextFlags, 61 uint32_t scalerContextFlags,
62 const SkMatrix& viewMatrix, 62 const SkMatrix& viewMatrix,
63 const SkSurfaceProps&, 63 const SkSurfaceProps&,
64 const SkTextBlob* blob, SkScalar x, SkScalar y, 64 const SkTextBlob* blob, SkScalar x, SkScalar y,
65 SkDrawFilter* drawFilter); 65 SkDrawFilter* drawFilter);
66 inline static bool HasLCD(const SkTextBlob*); 66 inline static bool HasLCD(const SkTextBlob*);
(...skipping 23 matching lines...) Expand all
90 SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable; 90 SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable;
91 91
92 #ifdef GR_TEST_UTILS 92 #ifdef GR_TEST_UTILS
93 static const uint32_t kTextBlobBatchScalerContextFlags = 93 static const uint32_t kTextBlobBatchScalerContextFlags =
94 SkPaint::kFakeGammaAndBoostContrast_ScalerContextFlags; 94 SkPaint::kFakeGammaAndBoostContrast_ScalerContextFlags;
95 DRAW_BATCH_TEST_FRIEND(TextBlobBatch); 95 DRAW_BATCH_TEST_FRIEND(TextBlobBatch);
96 #endif 96 #endif
97 }; 97 };
98 98
99 #endif 99 #endif
OLDNEW
« no previous file with comments | « src/gpu/text/GrAtlasTextBlob.cpp ('k') | src/gpu/text/GrAtlasTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698