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

Issue 143883006: No deduping dictionaries for matrices and regions. (Closed)

Created:
6 years, 11 months ago by mtklein
Modified:
6 years, 10 months ago
CC:
skia-review_googlegroups.com, Tom Hudson
Base URL:
https://skia.googlesource.com/skia.git@master
Visibility:
Public.

Description

No deduping dictionaries for matrices and regions. There's little benefit to deduping matrices and regions: they're infrequently used, and doubly infrequently reused. Their use-weighted byte cost is tiny. There is some downside to deduping matrices and regions. Even when they're not used, we prepare dictionaries for deduping them for every picture. Each of these dictionaries costs 160 bytes, so two unused dictionaries make a big chunk of the ~1100 bytes it takes to allocate an SkPictureRecord. (~330 come from parent class SkCanvas, 768 from SkPictureRecord itself, here reduced to 448). One side benefit of not deduping these guys is that the change weighs -140 lines of code. It may go without saying, but this breaks the picture format. Testing: out/Debug/tests && out/Debug/dm (which runs all picture modes by default) BUG=skia:1850 Committed: http://code.google.com/p/skia/source/detail?r=13149

Patch Set 1 #

Patch Set 2 : bump picture version #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -246 lines) Patch
M include/core/SkPath.h View 1 2 chunks +3 lines, -12 lines 0 comments Download
M include/core/SkPathRef.h View 1 1 chunk +1 line, -5 lines 0 comments Download
M include/core/SkPicture.h View 1 1 chunk +2 lines, -4 lines 0 comments Download
M src/core/SkPath.cpp View 1 2 chunks +2 lines, -14 lines 0 comments Download
M src/core/SkPathRef.cpp View 1 2 chunks +3 lines, -17 lines 0 comments Download
M src/core/SkPicture.cpp View 1 1 chunk +1 line, -6 lines 0 comments Download
M src/core/SkPictureFlat.h View 3 chunks +5 lines, -38 lines 0 comments Download
M src/core/SkPicturePlayback.h View 4 chunks +4 lines, -12 lines 0 comments Download
M src/core/SkPicturePlayback.cpp View 21 chunks +17 lines, -92 lines 0 comments Download
M src/core/SkPictureRecord.h View 2 chunks +0 lines, -3 lines 0 comments Download
M src/core/SkPictureRecord.cpp View 8 chunks +14 lines, -19 lines 0 comments Download
M src/effects/SkBlurMaskFilter.cpp View 1 1 chunk +1 line, -4 lines 0 comments Download
M src/effects/SkEmbossMaskFilter.cpp View 1 1 chunk +1 line, -4 lines 0 comments Download
M tests/CanvasTest.cpp View 2 chunks +0 lines, -16 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
mtklein
6 years, 11 months ago (2014-01-21 18:20:43 UTC) #1
reed1
bump version in SkPicture.h ? lgtm
6 years, 11 months ago (2014-01-21 18:38:59 UTC) #2
mtklein
Bumped to v19. Robert, can you take a look to see if all the picture ...
6 years, 11 months ago (2014-01-21 18:58:51 UTC) #3
mtklein
In case anyone's holding their breath, I'm going to delay submitting this and its new ...
6 years, 11 months ago (2014-01-21 20:00:22 UTC) #4
mtklein
On 2014/01/21 20:00:22, mtklein wrote: > In case anyone's holding their breath, I'm going to ...
6 years, 11 months ago (2014-01-23 14:49:40 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@google.com/143883006/50001
6 years, 11 months ago (2014-01-23 14:50:08 UTC) #6
rmistry
On 2014/01/23 14:49:40, mtklein wrote: > On 2014/01/21 20:00:22, mtklein wrote: > > In case ...
6 years, 11 months ago (2014-01-23 14:50:57 UTC) #7
mtklein
On 2014/01/23 14:50:57, rmistry wrote: > On 2014/01/23 14:49:40, mtklein wrote: > > On 2014/01/21 ...
6 years, 11 months ago (2014-01-23 14:53:38 UTC) #8
rmistry
On 2014/01/23 14:53:38, mtklein wrote: > On 2014/01/23 14:50:57, rmistry wrote: > > On 2014/01/23 ...
6 years, 11 months ago (2014-01-23 14:56:59 UTC) #9
mtklein
On 2014/01/23 14:56:59, rmistry wrote: > On 2014/01/23 14:53:38, mtklein wrote: > > On 2014/01/23 ...
6 years, 11 months ago (2014-01-23 14:57:44 UTC) #10
commit-bot: I haz the power
Change committed as 13149
6 years, 11 months ago (2014-01-23 15:16:11 UTC) #11
robertphillips
So I am (or was) using the matrix and region dictionaries extensively in this CL ...
6 years, 10 months ago (2014-01-31 19:22:39 UTC) #12
mtklein
6 years, 10 months ago (2014-01-31 19:32:35 UTC) #13
Message was sent while issue was closed.
On 2014/01/31 19:22:39, robertphillips wrote:
> So I am (or was) using the matrix and region dictionaries extensively in this
CL
> (https://codereview.chromium.org/139093003/). I wasn't relying on the
de-duping
> (since I am/was holding on to the id) as much as being able to concisely refer
> to matrices and regions over and over again.

If you're not deduping, can you just push onto an SkTDArray and hold the index? 
or ID them by the byte offset they're written to in the op stream?

Powered by Google App Engine
This is Rietveld 408576698