OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |