OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef GrAtlas_DEFINED | 9 #ifndef GrAtlas_DEFINED |
10 #define GrAtlas_DEFINED | 10 #define GrAtlas_DEFINED |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 friend class GrAtlas; | 85 friend class GrAtlas; |
86 }; | 86 }; |
87 | 87 |
88 GrAtlas(GrGpu*, GrPixelConfig, GrSurfaceFlags flags, | 88 GrAtlas(GrGpu*, GrPixelConfig, GrSurfaceFlags flags, |
89 const SkISize& backingTextureSize, | 89 const SkISize& backingTextureSize, |
90 int numPlotsX, int numPlotsY, bool batchUploads); | 90 int numPlotsX, int numPlotsY, bool batchUploads); |
91 ~GrAtlas(); | 91 ~GrAtlas(); |
92 | 92 |
93 // Adds a width x height subimage to the atlas. Upon success it returns | 93 // Adds a width x height subimage to the atlas. Upon success it returns |
94 // the containing GrPlot and absolute location in the backing texture. | 94 // the containing GrPlot and absolute location in the backing texture. |
95 // NULL is returned if the subimage cannot fit in the atlas. | 95 // nullptr is returned if the subimage cannot fit in the atlas. |
96 // If provided, the image data will either be immediately uploaded or | 96 // If provided, the image data will either be immediately uploaded or |
97 // written to the CPU-side backing bitmap. | 97 // written to the CPU-side backing bitmap. |
98 GrPlot* addToAtlas(ClientPlotUsage*, int width, int height, const void* imag
e, SkIPoint16* loc); | 98 GrPlot* addToAtlas(ClientPlotUsage*, int width, int height, const void* imag
e, SkIPoint16* loc); |
99 | 99 |
100 // remove reference to this plot | 100 // remove reference to this plot |
101 static void RemovePlot(ClientPlotUsage* usage, const GrPlot* plot); | 101 static void RemovePlot(ClientPlotUsage* usage, const GrPlot* plot); |
102 | 102 |
103 GrTexture* getTexture() const { | 103 GrTexture* getTexture() const { |
104 return fTexture; | 104 return fTexture; |
105 } | 105 } |
(...skipping 22 matching lines...) Expand all Loading... |
128 int fNumPlotsY; | 128 int fNumPlotsY; |
129 bool fBatchUploads; | 129 bool fBatchUploads; |
130 | 130 |
131 // allocated array of GrPlots | 131 // allocated array of GrPlots |
132 GrPlot* fPlotArray; | 132 GrPlot* fPlotArray; |
133 // LRU list of GrPlots (MRU at head - LRU at tail) | 133 // LRU list of GrPlots (MRU at head - LRU at tail) |
134 GrPlotList fPlotList; | 134 GrPlotList fPlotList; |
135 }; | 135 }; |
136 | 136 |
137 #endif | 137 #endif |
OLD | NEW |