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

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

Issue 1551563003: Reland of Make draw* lines responsible for cache management (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanuptext13reallytexutilsdf
Patch Set: Created 4 years, 11 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // A helper for drawing BitmapText in a run of distance fields 67 // A helper for drawing BitmapText in a run of distance fields
68 inline void fallbackDrawPosText(GrAtlasTextBlob*, int runIndex, 68 inline void fallbackDrawPosText(GrAtlasTextBlob*, int runIndex,
69 GrColor color, 69 GrColor color,
70 const SkPaint&, const SkMatrix& viewMatrix, 70 const SkPaint&, const SkMatrix& viewMatrix,
71 const SkTDArray<char>& fallbackTxt, 71 const SkTDArray<char>& fallbackTxt,
72 const SkTDArray<SkScalar>& fallbackPos, 72 const SkTDArray<SkScalar>& fallbackPos,
73 int scalarsPerPosition, 73 int scalarsPerPosition,
74 const SkPoint& offset); 74 const SkPoint& offset);
75 75
76 void internalDrawDFText(GrAtlasTextBlob*, int runIndex, 76 void internalDrawDFText(GrAtlasTextBlob*, int runIndex,
77 SkGlyphCache*, const SkPaint&, 77 const SkPaint&,
78 GrColor color, const SkMatrix& viewMatrix, 78 GrColor color, const SkMatrix& viewMatrix,
79 const char text[], size_t byteLength, 79 const char text[], size_t byteLength,
80 SkScalar x, SkScalar y, 80 SkScalar x, SkScalar y,
81 SkScalar textRatio, const SkPaint& origPaint); 81 SkScalar textRatio, const SkPaint& origPaint);
82 void internalDrawDFPosText(GrAtlasTextBlob*, int runIndex, 82 void internalDrawDFPosText(GrAtlasTextBlob*, int runIndex,
83 SkGlyphCache*, const SkPaint&, 83 const SkPaint&,
84 GrColor color, const SkMatrix& viewMatrix, 84 GrColor color, const SkMatrix& viewMatrix,
85 const char text[], size_t byteLength, 85 const char text[], size_t byteLength,
86 const SkScalar pos[], int scalarsPerPosition, 86 const SkScalar pos[], int scalarsPerPosition,
87 const SkPoint& offset, 87 const SkPoint& offset,
88 SkScalar textRatio, 88 SkScalar textRatio,
89 const SkPaint& origPaint); 89 const SkPaint& origPaint);
90 90
91 // sets up the descriptor on the blob and returns a detached cache. Client must attach 91 // sets up the descriptor on the blob and returns a detached cache. Client must attach
92 inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd); 92 inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd);
93 inline SkGlyphCache* setupCache(Run*, const SkPaint&, const SkMatrix* viewMa trix, bool noGamma);
94 void regenerateTextBlob(GrAtlasTextBlob* bmp, const SkPaint& skPaint, GrColo r, 93 void regenerateTextBlob(GrAtlasTextBlob* bmp, const SkPaint& skPaint, GrColo r,
95 const SkMatrix& viewMatrix, 94 const SkMatrix& viewMatrix,
96 const SkTextBlob* blob, SkScalar x, SkScalar y, 95 const SkTextBlob* blob, SkScalar x, SkScalar y,
97 SkDrawFilter* drawFilter, 96 SkDrawFilter* drawFilter,
98 const GrClip&); 97 const GrClip&);
99 inline static bool HasLCD(const SkTextBlob*); 98 inline static bool HasLCD(const SkTextBlob*);
100 inline void initDistanceFieldPaint(GrAtlasTextBlob*, SkPaint*, SkScalar* tex tRatio, 99 inline void initDistanceFieldPaint(GrAtlasTextBlob*, SkPaint*, SkScalar* tex tRatio,
101 const SkMatrix&); 100 const SkMatrix&);
102 101
103 // Test methods 102 // Test methods
(...skipping 14 matching lines...) Expand all
118 SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable; 117 SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable;
119 118
120 #ifdef GR_TEST_UTILS 119 #ifdef GR_TEST_UTILS
121 DRAW_BATCH_TEST_FRIEND(TextBlobBatch); 120 DRAW_BATCH_TEST_FRIEND(TextBlobBatch);
122 #endif 121 #endif
123 122
124 typedef GrTextContext INHERITED; 123 typedef GrTextContext INHERITED;
125 }; 124 };
126 125
127 #endif 126 #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