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

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

Issue 2165673002: Minor cleanup of GrStencilAndCoverTextContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Surprise! Created 4 years, 5 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/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 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 #ifndef GrStencilAndCoverTextContext_DEFINED 8 #ifndef GrStencilAndCoverTextContext_DEFINED
9 #define GrStencilAndCoverTextContext_DEFINED 9 #define GrStencilAndCoverTextContext_DEFINED
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 class TextRun { 71 class TextRun {
72 public: 72 public:
73 TextRun(const SkPaint& fontAndStroke); 73 TextRun(const SkPaint& fontAndStroke);
74 ~TextRun(); 74 ~TextRun();
75 75
76 void setText(const char text[], size_t byteLength, SkScalar x, SkScalar y); 76 void setText(const char text[], size_t byteLength, SkScalar x, SkScalar y);
77 77
78 void setPosText(const char text[], size_t byteLength, const SkScalar pos [], 78 void setPosText(const char text[], size_t byteLength, const SkScalar pos [],
79 int scalarsPerPosition, const SkPoint& offset); 79 int scalarsPerPosition, const SkPoint& offset);
80 80
81 void draw(GrContext*, GrDrawContext*, const GrPaint&, const GrClip&, GrC olor, 81 void draw(GrContext*, GrDrawContext*, const GrPaint&, const GrClip&,
82 const SkMatrix&, const SkSurfaceProps&, 82 const SkMatrix&, const SkSurfaceProps&,
83 SkScalar x, SkScalar y, const SkIRect& clipBounds, 83 SkScalar x, SkScalar y, const SkIRect& clipBounds,
84 GrAtlasTextContext* fallbackTextContext, const SkPaint& origin alSkPaint) const; 84 GrAtlasTextContext* fallbackTextContext, const SkPaint& origin alSkPaint) const;
85 85
86 void releaseGlyphCache() const; 86 void releaseGlyphCache() const;
87 87
88 size_t computeSizeInCache() const; 88 size_t computeSizeInCache() const;
89 89
90 bool isAntiAlias() const { return fFont.isAntiAlias(); }
91
90 private: 92 private:
91 typedef GrDrawPathRangeBatch::InstanceData InstanceData; 93 typedef GrDrawPathRangeBatch::InstanceData InstanceData;
92 94
93 SkGlyphCache* getGlyphCache() const; 95 SkGlyphCache* getGlyphCache() const;
94 GrPathRange* createGlyphs(GrContext*) const; 96 GrPathRange* createGlyphs(GrContext*) const;
95 void appendGlyph(const SkGlyph&, const SkPoint&, FallbackBlobBuilder*); 97 void appendGlyph(const SkGlyph&, const SkPoint&, FallbackBlobBuilder*);
96 98
97 GrStyle fStyle; 99 GrStyle fStyle;
98 SkPaint fFont; 100 SkPaint fFont;
99 SkScalar fTextRatio; 101 SkScalar fTextRatio;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 void purgeToFit(const TextBlob&); 150 void purgeToFit(const TextBlob&);
149 151
150 GrAtlasTextContext* fFallbackTextConte xt; 152 GrAtlasTextContext* fFallbackTextConte xt;
151 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache; 153 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache;
152 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache; 154 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache;
153 SkTInternalLList<TextBlob> fLRUList; 155 SkTInternalLList<TextBlob> fLRUList;
154 size_t fCacheSize; 156 size_t fCacheSize;
155 }; 157 };
156 158
157 #endif 159 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/text/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698