Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: src/core/SkTileGrid.h

Issue 490253003: Implement SkPicture::bytesUsed() for SkRecord backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move to SkPictureUtils, start unit test Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698