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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 ~GrAtlas(); | 87 ~GrAtlas(); |
88 | 88 |
89 // Adds a width x height subimage to the atlas. Upon success it returns | 89 // Adds a width x height subimage to the atlas. Upon success it returns |
90 // the containing GrPlot and absolute location in the backing texture. | 90 // the containing GrPlot and absolute location in the backing texture. |
91 // NULL is returned if the subimage cannot fit in the atlas. | 91 // NULL is returned if the subimage cannot fit in the atlas. |
92 // If provided, the image data will either be immediately uploaded or | 92 // If provided, the image data will either be immediately uploaded or |
93 // written to the CPU-side backing bitmap. | 93 // written to the CPU-side backing bitmap. |
94 GrPlot* addToAtlas(ClientPlotUsage*, int width, int height, const void* imag
e, SkIPoint16* loc); | 94 GrPlot* addToAtlas(ClientPlotUsage*, int width, int height, const void* imag
e, SkIPoint16* loc); |
95 | 95 |
96 // remove reference to this plot | 96 // remove reference to this plot |
97 void removePlot(ClientPlotUsage* usage, const GrPlot* plot); | 97 static void RemovePlot(ClientPlotUsage* usage, const GrPlot* plot); |
98 | 98 |
99 // get a plot that's not being used by the current draw | 99 // get a plot that's not being used by the current draw |
100 // this allows us to overwrite this plot without flushing | 100 // this allows us to overwrite this plot without flushing |
101 GrPlot* getUnusedPlot(); | 101 GrPlot* getUnusedPlot(); |
102 | 102 |
103 GrTexture* getTexture() const { | 103 GrTexture* getTexture() const { |
104 return fTexture; | 104 return fTexture; |
105 } | 105 } |
106 | 106 |
107 void uploadPlotsToTexture(); | 107 void uploadPlotsToTexture(); |
(...skipping 10 matching lines...) Expand all Loading... |
118 int fNumPlotsY; | 118 int fNumPlotsY; |
119 bool fBatchUploads; | 119 bool fBatchUploads; |
120 | 120 |
121 // allocated array of GrPlots | 121 // allocated array of GrPlots |
122 GrPlot* fPlotArray; | 122 GrPlot* fPlotArray; |
123 // LRU list of GrPlots (MRU at head - LRU at tail) | 123 // LRU list of GrPlots (MRU at head - LRU at tail) |
124 GrPlotList fPlotList; | 124 GrPlotList fPlotList; |
125 }; | 125 }; |
126 | 126 |
127 #endif | 127 #endif |
OLD | NEW |