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 |
11 #include "GrTexture.h" | 11 #include "GrTexture.h" |
12 #include "SkPoint.h" | 12 #include "SkPoint.h" |
13 #include "SkTDArray.h" | 13 #include "SkTDArray.h" |
14 #include "SkTInternalLList.h" | 14 #include "SkTInternalLList.h" |
15 | 15 |
16 #include "batches/GrDrawBatch.h" | 16 #include "batches/GrDrawBatch.h" |
17 | 17 |
18 class GrRectanizer; | 18 class GrRectanizer; |
19 | 19 |
20 struct GrBatchAtlasConfig { | 20 struct GrBatchAtlasConfig { |
21 int numPlotsX() const { return fWidth / fPlotWidth; } | 21 int numPlotsX() const { return fWidth / fPlotWidth; } |
22 int numPlotsY() const { return fHeight / fPlotWidth; } | 22 int numPlotsY() const { return fHeight / fPlotWidth; } |
23 int log2Width() const { return SkNextLog2(fWidth); } | |
24 int log2Height() const { return SkNextLog2(fHeight); } | |
joshualitt
2016/02/18 20:12:11
is it worth caching these?
jvanverth1
2016/02/18 20:21:20
Yes, that makes sense.
| |
23 int fWidth; | 25 int fWidth; |
24 int fHeight; | 26 int fHeight; |
25 int fPlotWidth; | 27 int fPlotWidth; |
26 int fPlotHeight; | 28 int fPlotHeight; |
27 }; | 29 }; |
28 | 30 |
29 class GrBatchAtlas { | 31 class GrBatchAtlas { |
30 public: | 32 public: |
31 // An AtlasID is an opaque handle which callers can use to determine if the atlas contains | 33 // An AtlasID is an opaque handle which callers can use to determine if the atlas contains |
32 // a specific piece of data | 34 // a specific piece of data |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 }; | 259 }; |
258 | 260 |
259 SkTDArray<EvictionData> fEvictionCallbacks; | 261 SkTDArray<EvictionData> fEvictionCallbacks; |
260 // allocated array of GrBatchPlots | 262 // allocated array of GrBatchPlots |
261 SkAutoTUnref<BatchPlot>* fPlotArray; | 263 SkAutoTUnref<BatchPlot>* fPlotArray; |
262 // LRU list of GrPlots (MRU at head - LRU at tail) | 264 // LRU list of GrPlots (MRU at head - LRU at tail) |
263 GrBatchPlotList fPlotList; | 265 GrBatchPlotList fPlotList; |
264 }; | 266 }; |
265 | 267 |
266 #endif | 268 #endif |
OLD | NEW |