| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkTileGrid_DEFINED | 8 #ifndef SkTileGrid_DEFINED |
| 9 #define SkTileGrid_DEFINED | 9 #define SkTileGrid_DEFINED |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 virtual int getCount() const SK_OVERRIDE { return fCount; } | 43 virtual int getCount() const SK_OVERRIDE { return fCount; } |
| 44 | 44 |
| 45 virtual int getDepth() const SK_OVERRIDE { return -1; } | 45 virtual int getDepth() const SK_OVERRIDE { return -1; } |
| 46 | 46 |
| 47 virtual void rewindInserts() SK_OVERRIDE; | 47 virtual void rewindInserts() SK_OVERRIDE; |
| 48 | 48 |
| 49 // For testing. | 49 // For testing. |
| 50 int tileCount(int x, int y) { return fTiles[y * fXTiles + x].count(); } | 50 int tileCount(int x, int y) { return fTiles[y * fXTiles + x].count(); } |
| 51 | 51 |
| 52 virtual size_t bytesUsed() const SK_OVERRIDE; |
| 53 |
| 52 private: | 54 private: |
| 53 struct Entry { | 55 struct Entry { |
| 54 size_t order; // Insertion order. Used to preserve order when merging
multiple tiles. | 56 size_t order; // Insertion order. Used to preserve order when merging
multiple tiles. |
| 55 void* data; | 57 void* data; |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 const int fXTiles, fYTiles; | 60 const int fXTiles, fYTiles; |
| 59 SkTileGridFactory::TileGridInfo fInfo; | 61 SkTileGridFactory::TileGridInfo fInfo; |
| 60 size_t fCount; | 62 size_t fCount; |
| 61 | 63 |
| 62 // (fXTiles * fYTiles) SkTDArrays, each listing data overlapping that tile i
n insertion order. | 64 // (fXTiles * fYTiles) SkTDArrays, each listing data overlapping that tile i
n insertion order. |
| 63 SkTDArray<Entry>* fTiles; | 65 SkTDArray<Entry>* fTiles; |
| 64 | 66 |
| 65 typedef SkBBoxHierarchy INHERITED; | 67 typedef SkBBoxHierarchy INHERITED; |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 #endif | 70 #endif |
| OLD | NEW |