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

Side by Side Diff: src/gpu/GrBatchFontCache.h

Issue 1050113004: Adding bulk plot reffer to cached textblobs (Closed) Base URL: https://skia.googlesource.com/skia.git@atlastext
Patch Set: rebase Created 5 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/GrBatchAtlas.cpp ('k') | src/gpu/GrBatchFontCache.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 GrBatchFontCache_DEFINED 8 #ifndef GrBatchFontCache_DEFINED
9 #define GrBatchFontCache_DEFINED 9 #define GrBatchFontCache_DEFINED
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 GrBatchTextStrike* strike = fCache.find(*(scaler->getKey())); 90 GrBatchTextStrike* strike = fCache.find(*(scaler->getKey()));
91 if (NULL == strike) { 91 if (NULL == strike) {
92 strike = this->generateStrike(scaler); 92 strike = this->generateStrike(scaler);
93 } 93 }
94 return strike; 94 return strike;
95 } 95 }
96 96
97 bool hasGlyph(GrGlyph* glyph); 97 bool hasGlyph(GrGlyph* glyph);
98 98
99 // To ensure the GrBatchAtlas does not evict the Glyph Mask from its texture backing store, 99 // To ensure the GrBatchAtlas does not evict the Glyph Mask from its texture backing store,
100 // the client must pass in the currentToken from the GrBatchTarget along wit h the GrGlyph 100 // the client must pass in the currentToken from the GrBatchTarget along wit h the GrGlyph.
101 void setGlyphRefToken(GrGlyph*, GrBatchAtlas::BatchToken); 101 // A BulkUseTokenUpdater is used to manage bulk last use token updating in t he Atlas.
102 // For convenience, this function will also set the use token for the curren t glyph if required
103 // NOTE: the bulk uploader is only valid if the subrun has a valid atlasGene ration
104 void addGlyphToBulkAndSetUseToken(GrBatchAtlas::BulkUseTokenUpdater*, GrGlyp h*,
105 GrBatchAtlas::BatchToken);
106
107 void setUseTokenBulk(const GrBatchAtlas::BulkUseTokenUpdater&, GrBatchAtlas: :BatchToken,
108 GrMaskFormat);
102 109
103 // add to texture atlas that matches this format 110 // add to texture atlas that matches this format
104 bool addToAtlas(GrBatchTextStrike*, GrBatchAtlas::AtlasID*, GrBatchTarget*, 111 bool addToAtlas(GrBatchTextStrike*, GrBatchAtlas::AtlasID*, GrBatchTarget*,
105 GrMaskFormat, int width, int height, const void* image, 112 GrMaskFormat, int width, int height, const void* image,
106 SkIPoint16* loc); 113 SkIPoint16* loc);
107 114
108 // Some clients may wish to verify the integrity of the texture backing stor e of the 115 // Some clients may wish to verify the integrity of the texture backing stor e of the
109 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr easing number which 116 // GrBatchAtlas. The atlasGeneration returned below is a monitonically incr easing number which
110 // changes everytime something is removed from the texture backing store. 117 // changes everytime something is removed from the texture backing store.
111 uint64_t atlasGeneration(GrMaskFormat) const; 118 uint64_t atlasGeneration(GrMaskFormat) const;
(...skipping 16 matching lines...) Expand all
128 135
129 static void HandleEviction(GrBatchAtlas::AtlasID, void*); 136 static void HandleEviction(GrBatchAtlas::AtlasID, void*);
130 137
131 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache; 138 SkTDynamicHash<GrBatchTextStrike, GrFontDescKey> fCache;
132 139
133 GrBatchAtlas* fAtlases[kMaskFormatCount]; 140 GrBatchAtlas* fAtlases[kMaskFormatCount];
134 GrBatchTextStrike* fPreserveStrike; 141 GrBatchTextStrike* fPreserveStrike;
135 }; 142 };
136 143
137 #endif 144 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrBatchAtlas.cpp ('k') | src/gpu/GrBatchFontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698