Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(727)

Issue 7311075: Clean-up tile grid query results using intersection testing

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 9 months ago by junov1
Modified:
12 years, 7 months ago
Reviewers:
reed1, TomH
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Clean-up tile grid query results using intersection testing This CL aims to reject out of bounds draws earlier in the SkPicture playback pipeline when using a tileGrid. Tile grid queries that are not exactly aligned with the tile grid can be pretty common. This CL aims to optimize that case by performing a bounds test on each element before adding it to the results. To perform the test at a very low cost, we take advantage of the fact that bounding boxes are already being computed at record time for constructing a BBoxHierarchy. SkTileGrid will now store this information so that it can be used in query execution. This saves the overhead of processing commands that will later be rejected by SkCanvas::quickReject. In some cases this will even eliminate unnecessary draws that would not have been detected by quickReject such as drawText calls. TEST=TileGrid unit test

Patch Set 1 #

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+179 lines, -32 lines) Patch
M src/core/SkTileGrid.h View 1 2 4 chunks +74 lines, -10 lines 0 comments Download
M src/core/SkTileGrid.cpp View 1 2 5 chunks +83 lines, -15 lines 0 comments Download
M src/core/SkTileGridPicture.cpp View 1 2 1 chunk +6 lines, -1 line 0 comments Download
M tests/TileGridTest.cpp View 1 chunk +16 lines, -6 lines 0 comments Download

Messages

Total messages: 22
junov1
PTAL
12 years, 9 months ago (2013-02-11 15:39:36 UTC) #1
TomH
Good idea. What are the RAM & CPU impacts?
12 years, 9 months ago (2013-02-11 15:43:58 UTC) #2
junov1
On 2013/02/11 15:43:58, TomH wrote: > Good idea. What are the RAM & CPU impacts? ...
12 years, 9 months ago (2013-02-11 16:01:44 UTC) #3
reed1
A sizable RAM cost, at least proportionately. Perhaps you could publish some abs values for ...
12 years, 9 months ago (2013-02-11 17:19:55 UTC) #4
junov1
So I ran some benchmark tests. Not sure where to dump the full results (no ...
12 years, 9 months ago (2013-02-11 21:15:28 UTC) #5
junov1
Another idea I want to try next: When using a BBoxHierarchy, we should skip the ...
12 years, 9 months ago (2013-02-11 21:34:08 UTC) #6
reed1
We know the ram increase is 5x on a 32bit machine. What does that come ...
12 years, 9 months ago (2013-02-12 15:18:24 UTC) #7
reed1
I certainly like the idea of faster bounds rejects, but I want us to recognize ...
12 years, 9 months ago (2013-02-12 15:20:41 UTC) #8
junov1
On 2013/02/12 15:20:41, reed1 wrote: > I certainly like the idea of faster bounds rejects, ...
12 years, 9 months ago (2013-02-12 15:54:10 UTC) #9
junov1
To measure the RAM cost of adding 1 Rect per draw is potentially big. I ...
12 years, 9 months ago (2013-02-12 15:57:43 UTC) #10
junov1
I instrumented bench_pictures to count the number of bounding boxes that are being recorded. I ...
12 years, 9 months ago (2013-02-12 16:32:57 UTC) #11
junov1
Editing error: > Unique rectangles seldom and average discount of about 50% on average I ...
12 years, 9 months ago (2013-02-12 16:35:19 UTC) #12
TomH
Justin, I think the metic Mike's been asking for since the beginning is the right ...
12 years, 9 months ago (2013-02-12 21:07:10 UTC) #13
junov1
Wasn't that answered in my previous post? Extra data consumption in TileGrid structure < 160KB ...
12 years, 9 months ago (2013-02-12 21:26:07 UTC) #14
junov1
Just uploaded Patch Set 3 This version of the patch reduce memory consumption by using ...
12 years, 9 months ago (2013-02-12 21:43:19 UTC) #15
junov1
Given these results I am inclined to clean-up the patch and just keep the new ...
12 years, 9 months ago (2013-02-13 16:03:06 UTC) #16
TomH
Justin, you still haven't answered Mike's question. And certainly without that I don't think the ...
12 years, 9 months ago (2013-02-13 16:07:21 UTC) #17
junov1
In order to provide clear metrics. I started working on another patch that will add ...
12 years, 9 months ago (2013-02-13 18:09:57 UTC) #18
TomH
Another patch and benchmarking feels like a big step. Little steps might be: 1) hack ...
12 years, 9 months ago (2013-02-14 11:54:36 UTC) #19
junov1
Yeah I found some old code inside #ifdef SK_DEBUG_SIZE but it is severely rotten. I ...
12 years, 9 months ago (2013-02-14 15:03:17 UTC) #20
junov1
Generated some stats : https://docs.google.com/a/google.com/spreadsheet/ccc?key=0AkZDOrGmY3OfdDgxV2hHRXF5MFprTXl5VHh2SVFWUEE#gid=0 (viewable by skia-dev) The memory consumption numbers do not include ...
12 years, 9 months ago (2013-02-14 22:04:04 UTC) #21
TomH
12 years, 7 months ago (2013-04-05 14:38:29 UTC) #22
I added a couple of columns to that document (L, M); are those correct? If so, they suggest that the typical overhead of tracking bounding boxes is 4% of the opcode stream, or < 1% of the total size - usually 4kB or so. Worst-case is pokemonwiki, which has a huge table bloating the number of objects; that's only about 130kB.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b