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

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

Issue 2163483002: Use SkFont in GrStencilAndCoverTextContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT 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
11 #include "GrDrawContext.h" 11 #include "GrDrawContext.h"
12 #include "GrStyle.h" 12 #include "GrStyle.h"
13 #include "SkDrawFilter.h" 13 #include "SkDrawFilter.h"
14 #include "SkFont.h"
14 #include "SkTextBlob.h" 15 #include "SkTextBlob.h"
15 #include "SkTHash.h" 16 #include "SkTHash.h"
16 #include "SkTInternalLList.h" 17 #include "SkTInternalLList.h"
17 #include "SkTLList.h" 18 #include "SkTLList.h"
18 #include "batches/GrDrawPathBatch.h" 19 #include "batches/GrDrawPathBatch.h"
19 20
20 class GrAtlasTextContext; 21 class GrAtlasTextContext;
21 class GrTextStrike; 22 class GrTextStrike;
22 class GrPath; 23 class GrPath;
23 class SkSurfaceProps; 24 class SkSurfaceProps;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 81
81 void draw(GrContext*, GrDrawContext*, const GrPaint&, const GrClip&, 82 void draw(GrContext*, GrDrawContext*, const GrPaint&, const GrClip&,
82 const SkMatrix&, const SkSurfaceProps&, 83 const SkMatrix&, const SkSurfaceProps&,
83 SkScalar x, SkScalar y, const SkIRect& clipBounds, 84 SkScalar x, SkScalar y, const SkIRect& clipBounds,
84 GrAtlasTextContext* fallbackTextContext, const SkPaint& origin alSkPaint) const; 85 GrAtlasTextContext* fallbackTextContext, const SkPaint& origin alSkPaint) const;
85 86
86 void releaseGlyphCache() const; 87 void releaseGlyphCache() const;
87 88
88 size_t computeSizeInCache() const; 89 size_t computeSizeInCache() const;
89 90
90 bool isAntiAlias() const { return fFont.isAntiAlias(); } 91 bool isAntiAlias() const { return true; }
91 92
92 private: 93 private:
93 typedef GrDrawPathRangeBatch::InstanceData InstanceData; 94 typedef GrDrawPathRangeBatch::InstanceData InstanceData;
94 95
95 SkGlyphCache* getGlyphCache() const; 96 SkGlyphCache* getGlyphCache() const;
96 GrPathRange* createGlyphs(GrContext*) const; 97 GrPathRange* createGlyphs(GrContext*) const;
97 void appendGlyph(const SkGlyph&, const SkPoint&, FallbackBlobBuilder*); 98 void appendGlyph(const SkGlyph&, const SkPoint&, FallbackBlobBuilder*);
98 99
99 GrStyle fStyle; 100 GrStyle fStyle;
100 SkPaint fFont; 101
102 sk_sp<SkFont> fFont;
103 SkTextEncoding fTextEncoding;
104 SkPaint::Align fTextAlign;
105
101 SkScalar fTextRatio; 106 SkScalar fTextRatio;
102 float fTextInverseRatio; 107 float fTextInverseRatio;
103 bool fUsingRawGlyphPaths; 108 bool fUsingRawGlyphPaths;
104 GrUniqueKey fGlyphPathsKey; 109 GrUniqueKey fGlyphPathsKey;
105 int fTotalGlyphCount; 110 int fTotalGlyphCount;
106 SkAutoTUnref<InstanceData> fInstanceData; 111 SkAutoTUnref<InstanceData> fInstanceData;
107 int fFallbackGlyphCount; 112 int fFallbackGlyphCount;
108 SkAutoTUnref<const SkTextBlob> fFallbackTextBlob; 113 SkAutoTUnref<const SkTextBlob> fFallbackTextBlob;
109 mutable SkGlyphCache* fDetachedGlyphCache; 114 mutable SkGlyphCache* fDetachedGlyphCache;
110 mutable uint32_t fLastDrawnGlyphsID; 115 mutable uint32_t fLastDrawnGlyphsID;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 void purgeToFit(const TextBlob&); 155 void purgeToFit(const TextBlob&);
151 156
152 GrAtlasTextContext* fFallbackTextConte xt; 157 GrAtlasTextContext* fFallbackTextConte xt;
153 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache; 158 SkTHashMap<uint32_t, TextBlob*> fBlobIdCache;
154 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache; 159 SkTHashTable<TextBlob*, const TextBlob::Key&, TextBlob> fBlobKeyCache;
155 SkTInternalLList<TextBlob> fLRUList; 160 SkTInternalLList<TextBlob> fLRUList;
156 size_t fCacheSize; 161 size_t fCacheSize;
157 }; 162 };
158 163
159 #endif 164 #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