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 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
11 #include "GrGpu.h" | 11 #include "GrGpu.h" |
12 #include "GrRectanizer.h" | 12 #include "GrRectanizer.h" |
13 | 13 |
14 #if 0 | 14 #if 0 |
15 #define GR_PLOT_WIDTH 8 | 15 #define GR_PLOT_WIDTH 8 |
16 #define GR_PLOT_HEIGHT 4 | 16 #define GR_PLOT_HEIGHT 4 |
17 #define GR_ATLAS_WIDTH 256 | 17 #define GR_ATLAS_WIDTH 256 |
18 #define GR_ATLAS_HEIGHT 256 | 18 #define GR_ATLAS_HEIGHT 256 |
19 | 19 |
20 #define GR_ATLAS_TEXTURE_WIDTH (GR_PLOT_WIDTH * GR_ATLAS_WIDTH) | 20 #define GR_ATLAS_TEXTURE_WIDTH (GR_PLOT_WIDTH * GR_ATLAS_WIDTH) |
21 #define GR_ATLAS_TEXTURE_HEIGHT (GR_PLOT_HEIGHT * GR_ATLAS_HEIGHT) | 21 #define GR_ATLAS_TEXTURE_HEIGHT (GR_PLOT_HEIGHT * GR_ATLAS_HEIGHT) |
22 | 22 |
23 #else | 23 #else |
24 | 24 |
25 #define GR_ATLAS_TEXTURE_WIDTH 1024 | 25 #define GR_ATLAS_TEXTURE_WIDTH 1024 |
26 #define GR_ATLAS_TEXTURE_HEIGHT 2048 | 26 #define GR_ATLAS_TEXTURE_HEIGHT 2048 |
27 | 27 |
28 #define GR_ATLAS_WIDTH 341 | 28 #define GR_ATLAS_WIDTH 256 |
29 #define GR_ATLAS_HEIGHT 341 | 29 #define GR_ATLAS_HEIGHT 256 |
30 | 30 |
31 #define GR_PLOT_WIDTH (GR_ATLAS_TEXTURE_WIDTH / GR_ATLAS_WIDTH) | 31 #define GR_PLOT_WIDTH (GR_ATLAS_TEXTURE_WIDTH / GR_ATLAS_WIDTH) |
32 #define GR_PLOT_HEIGHT (GR_ATLAS_TEXTURE_HEIGHT / GR_ATLAS_HEIGHT) | 32 #define GR_PLOT_HEIGHT (GR_ATLAS_TEXTURE_HEIGHT / GR_ATLAS_HEIGHT) |
33 | 33 |
34 #endif | 34 #endif |
35 | 35 |
36 /////////////////////////////////////////////////////////////////////////////// | 36 /////////////////////////////////////////////////////////////////////////////// |
37 | 37 |
38 #define BORDER 1 | 38 #define BORDER 1 |
39 | 39 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 253 |
254 plot->fRects->reset(); | 254 plot->fRects->reset(); |
255 plot->fNext = fFreePlots; | 255 plot->fNext = fFreePlots; |
256 fFreePlots = plot; | 256 fFreePlots = plot; |
257 | 257 |
258 #ifdef SK_DEBUG | 258 #ifdef SK_DEBUG |
259 --gCounter; | 259 --gCounter; |
260 // GrPrintf("~GrPlot %p [%d %d] %d\n", this, plot->fOffset.fX, plot->fOffset.
fY, gCounter); | 260 // GrPrintf("~GrPlot %p [%d %d] %d\n", this, plot->fOffset.fX, plot->fOffset.
fY, gCounter); |
261 #endif | 261 #endif |
262 } | 262 } |
OLD | NEW |