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

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

Issue 1093083003: Some simple optimizations for improving GrAtlasTextContext perf (Closed) Base URL: https://skia.googlesource.com/skia.git@atdfregen
Patch Set: simple optimizations 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/GrAtlasTextContext.cpp ('k') | src/gpu/GrBatchFontCache.h » ('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 GrBatchAtlas_DEFINED 8 #ifndef GrBatchAtlas_DEFINED
9 #define GrBatchAtlas_DEFINED 9 #define GrBatchAtlas_DEFINED
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 SkAutoSTMalloc<kMinItems, int> fPlotsToUpdate; 105 SkAutoSTMalloc<kMinItems, int> fPlotsToUpdate;
106 uint32_t fPlotAlreadyUpdated; 106 uint32_t fPlotAlreadyUpdated;
107 int fCount; 107 int fCount;
108 int fAllocated; 108 int fAllocated;
109 109
110 friend class GrBatchAtlas; 110 friend class GrBatchAtlas;
111 }; 111 };
112 112
113 void setLastUseTokenBulk(const BulkUseTokenUpdater& reffer, BatchToken); 113 void setLastUseTokenBulk(const BulkUseTokenUpdater& reffer, BatchToken);
114 114
115 static const int kGlyphMaxDim = 256;
116 static bool GlyphTooLargeForAtlas(int width, int height) {
117 return width > kGlyphMaxDim || height > kGlyphMaxDim;
118 }
119
115 private: 120 private:
116 static int GetIndexFromID(AtlasID id) { 121 static int GetIndexFromID(AtlasID id) {
117 return id & 0xffff; 122 return id & 0xffff;
118 } 123 }
119 124
120 static int GetGenerationFromID(AtlasID id) { 125 static int GetGenerationFromID(AtlasID id) {
121 return (id >> 16) & 0xffff; 126 return (id >> 16) & 0xffff;
122 } 127 }
123 128
124 inline void updatePlot(GrBatchTarget*, AtlasID*, BatchPlot*); 129 inline void updatePlot(GrBatchTarget*, AtlasID*, BatchPlot*);
(...skipping 16 matching lines...) Expand all
141 }; 146 };
142 147
143 SkTDArray<EvictionData> fEvictionCallbacks; 148 SkTDArray<EvictionData> fEvictionCallbacks;
144 // allocated array of GrBatchPlots 149 // allocated array of GrBatchPlots
145 SkAutoTUnref<BatchPlot>* fPlotArray; 150 SkAutoTUnref<BatchPlot>* fPlotArray;
146 // LRU list of GrPlots (MRU at head - LRU at tail) 151 // LRU list of GrPlots (MRU at head - LRU at tail)
147 GrBatchPlotList fPlotList; 152 GrBatchPlotList fPlotList;
148 }; 153 };
149 154
150 #endif 155 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrBatchFontCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698