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

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

Issue 639933003: Add SkBBoxHierarchy::reserve() as an optional size hint. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 2 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
« no previous file with comments | « src/core/SkRecordDraw.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 12 matching lines...) Expand all
23 virtual ~SkTileGrid(); 23 virtual ~SkTileGrid();
24 24
25 /** 25 /**
26 * Insert a opIndex value and corresponding bounding box 26 * Insert a opIndex value and corresponding bounding box
27 * @param opIndex 27 * @param opIndex
28 * @param bounds The bounding box, should not be empty. 28 * @param bounds The bounding box, should not be empty.
29 * @param defer Ignored; SkTileGrid does not defer insertions. 29 * @param defer Ignored; SkTileGrid does not defer insertions.
30 */ 30 */
31 virtual void insert(unsigned opIndex, const SkRect& bounds, bool) SK_OVERRID E; 31 virtual void insert(unsigned opIndex, const SkRect& bounds, bool) SK_OVERRID E;
32 32
33 virtual void flushDeferredInserts() SK_OVERRIDE {};
34
35 /** 33 /**
36 * Populate 'results' with opIndexes corresponding to bounding boxes that in tersect 'query'. 34 * Populate 'results' with opIndexes corresponding to bounding boxes that in tersect 'query'.
37 * This will be fastest if the query is an exact match to a single grid tile . 35 * This will be fastest if the query is an exact match to a single grid tile .
38 */ 36 */
39 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE; 37 virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE;
40 38
41 // For testing. 39 // For testing.
42 int tileCount(int x, int y) { return fTiles[y * fXTiles + x].count(); } 40 int tileCount(int x, int y) { return fTiles[y * fXTiles + x].count(); }
43 41
44 private: 42 private:
45 void commonAdjust(SkRect*) const; 43 void commonAdjust(SkRect*) const;
46 void userToGrid(const SkRect&, SkIRect* grid) const; 44 void userToGrid(const SkRect&, SkIRect* grid) const;
47 45
48 const int fXTiles, fYTiles; 46 const int fXTiles, fYTiles;
49 const SkScalar fInvWidth, fInvHeight; 47 const SkScalar fInvWidth, fInvHeight;
50 const SkScalar fMarginWidth, fMarginHeight; 48 const SkScalar fMarginWidth, fMarginHeight;
51 const SkPoint fOffset; 49 const SkPoint fOffset;
52 const SkRect fGridBounds; 50 const SkRect fGridBounds;
53 51
54 // (fXTiles * fYTiles) SkTDArrays, each listing ops overlapping that tile in order. 52 // (fXTiles * fYTiles) SkTDArrays, each listing ops overlapping that tile in order.
55 SkTDArray<unsigned>* fTiles; 53 SkTDArray<unsigned>* fTiles;
56 54
57 typedef SkBBoxHierarchy INHERITED; 55 typedef SkBBoxHierarchy INHERITED;
58 }; 56 };
59 57
60 #endif 58 #endif
OLDNEW
« no previous file with comments | « src/core/SkRecordDraw.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698