OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrPlotMgr_DEFINED | 8 #ifndef GrPlotMgr_DEFINED |
9 #define GrPlotMgr_DEFINED | 9 #define GrPlotMgr_DEFINED |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 this->reset(); | 25 this->reset(); |
26 } | 26 } |
27 | 27 |
28 ~GrPlotMgr() { | 28 ~GrPlotMgr() { |
29 if (fBusy != fStorage) { | 29 if (fBusy != fStorage) { |
30 delete[] fBusy; | 30 delete[] fBusy; |
31 } | 31 } |
32 } | 32 } |
33 | 33 |
34 void reset() { | 34 void reset() { |
35 Gr_bzero(fBusy, fDim.fX * fDim.fY); | 35 sk_bzero(fBusy, fDim.fX * fDim.fY); |
36 } | 36 } |
37 | 37 |
38 bool newPlot(GrIPoint16* loc) { | 38 bool newPlot(GrIPoint16* loc) { |
39 char* busy = fBusy; | 39 char* busy = fBusy; |
40 for (int y = 0; y < fDim.fY; y++) { | 40 for (int y = 0; y < fDim.fY; y++) { |
41 for (int x = 0; x < fDim.fX; x++) { | 41 for (int x = 0; x < fDim.fX; x++) { |
42 if (!*busy) { | 42 if (!*busy) { |
43 *busy = true; | 43 *busy = true; |
44 loc->set(x, y); | 44 loc->set(x, y); |
45 return true; | 45 return true; |
(...skipping 19 matching lines...) Expand all Loading... |
65 private: | 65 private: |
66 enum { | 66 enum { |
67 STORAGE = 64 | 67 STORAGE = 64 |
68 }; | 68 }; |
69 char fStorage[STORAGE]; | 69 char fStorage[STORAGE]; |
70 char* fBusy; | 70 char* fBusy; |
71 GrIPoint16 fDim; | 71 GrIPoint16 fDim; |
72 }; | 72 }; |
73 | 73 |
74 #endif | 74 #endif |
OLD | NEW |