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

Issue 6459105: Implement multi-threaded picture playback via cloning. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 8 months ago by DerekS
Modified:
10 years, 2 months ago
Reviewers:
Leon, mtklein, TomH
CC:
skia-review_googlegroups.com, iancottrell
Base URL:
https://skia.googlecode.com/svn/trunk
Visibility:
Public.

Description

Implement multi-threaded picture playback via cloning. The CL adds SkPicture.clone() which produces a thread-safe copy by creating a shallow copy of the thread-safe data within the picture and a deep copy of the data that is not (e.g. SkPaint). This implementation re-flattens the paints when cloning instead of retaining the flattened paints from the recording process. Changes were also needed to various classes to ensure thread safety Committed: https://code.google.com/p/skia/source/detail?r=5335

Patch Set 1 #

Total comments: 1

Patch Set 2 : reuse work when creating more than 1 clone #

Total comments: 12

Patch Set 3 : fixes from the code review #

Total comments: 14

Patch Set 4 : refactor based on comments #

Total comments: 1

Patch Set 5 : class to struct #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -41 lines) Patch
M include/core/SkColorTable.h View 1 chunk +1 line, -1 line 0 comments Download
M include/core/SkInstCnt.h View 1 2 chunks +4 lines, -3 lines 0 comments Download
M include/core/SkPicture.h View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
M src/core/SkColorTable.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPath.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPicture.cpp View 1 2 3 1 chunk +31 lines, -0 lines 2 comments Download
M src/core/SkPicturePlayback.h View 1 2 3 4 2 chunks +17 lines, -3 lines 0 comments Download
M src/core/SkPicturePlayback.cpp View 1 2 3 8 chunks +75 lines, -27 lines 0 comments Download
M src/core/SkPictureRecord.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPictureRecord.cpp View 1 2 chunks +4 lines, -2 lines 0 comments Download
M tests/CanvasTest.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 11
DerekS
11 years, 8 months ago (2012-08-20 18:03:42 UTC) #1
Leon
http://codereview.appspot.com/6459105/diff/1/src/core/SkPicturePlayback.h File src/core/SkPicturePlayback.h (right): http://codereview.appspot.com/6459105/diff/1/src/core/SkPicturePlayback.h#newcode170 src/core/SkPicturePlayback.h:170: SkRefPtr<SkBitmapHeap> fBitmapHeap; SkRefPtr is discouraged. I think Ben has ...
11 years, 8 months ago (2012-08-20 19:25:57 UTC) #2
Leon
Looks good overall, with some nits. http://codereview.appspot.com/6459105/diff/4001/include/core/SkRefCnt.h File include/core/SkRefCnt.h (right): http://codereview.appspot.com/6459105/diff/4001/include/core/SkRefCnt.h#newcode157 include/core/SkRefCnt.h:157: // TODO why ...
11 years, 7 months ago (2012-08-28 21:29:46 UTC) #3
DerekS
https://codereview.appspot.com/6459105/diff/4001/include/core/SkRefCnt.h File include/core/SkRefCnt.h (right): https://codereview.appspot.com/6459105/diff/4001/include/core/SkRefCnt.h#newcode157 include/core/SkRefCnt.h:157: // TODO why can't we have this? On 2012/08/28 ...
11 years, 7 months ago (2012-08-29 14:38:32 UTC) #4
Leon
https://codereview.appspot.com/6459105/diff/19001/include/core/SkPicture.h File include/core/SkPicture.h (right): https://codereview.appspot.com/6459105/diff/19001/include/core/SkPicture.h#newcode55 include/core/SkPicture.h:55: SkPicture* clone(); const https://codereview.appspot.com/6459105/diff/19001/include/core/SkPicture.h#newcode58 include/core/SkPicture.h:58: * Creates multiple thread-safe ...
11 years, 7 months ago (2012-08-29 15:59:10 UTC) #5
DerekS
https://codereview.appspot.com/6459105/diff/19001/include/core/SkPicture.h File include/core/SkPicture.h (right): https://codereview.appspot.com/6459105/diff/19001/include/core/SkPicture.h#newcode55 include/core/SkPicture.h:55: SkPicture* clone(); On 2012/08/29 15:59:10, scroggo-work wrote: > const ...
11 years, 7 months ago (2012-08-29 18:16:03 UTC) #6
Leon
lgtm https://codereview.appspot.com/6459105/diff/11005/src/core/SkPicturePlayback.h File src/core/SkPicturePlayback.h (right): https://codereview.appspot.com/6459105/diff/11005/src/core/SkPicturePlayback.h#newcode49 src/core/SkPicturePlayback.h:49: class SkPictCopyInfo { Minor nit: could be a ...
11 years, 7 months ago (2012-08-29 18:32:14 UTC) #7
TomH
https://codereview.appspot.com/6459105/diff/8016/src/core/SkPicture.cpp File src/core/SkPicture.cpp (right): https://codereview.appspot.com/6459105/diff/8016/src/core/SkPicture.cpp#newcode159 src/core/SkPicture.cpp:159: it (since it is destructive, and we don't want ...
10 years, 2 months ago (2014-02-14 12:32:12 UTC) #8
Leon
https://codereview.appspot.com/6459105/diff/8016/src/core/SkPicture.cpp File src/core/SkPicture.cpp (right): https://codereview.appspot.com/6459105/diff/8016/src/core/SkPicture.cpp#newcode159 src/core/SkPicture.cpp:159: it (since it is destructive, and we don't want ...
10 years, 2 months ago (2014-02-14 14:45:21 UTC) #9
TomH
Oops, forgot to +Ian last time. IIUC, when we transition from SkPictureRecord -> SkPicturePlayback, some ...
10 years, 2 months ago (2014-02-14 14:56:30 UTC) #10
mtklein
10 years, 2 months ago (2014-02-14 14:58:32 UTC) #11
Message was sent while issue was closed.
On 2014/02/14 14:56:30, TomH wrote:
> Oops, forgot to +Ian last time.
> 
> IIUC, when we transition from SkPictureRecord -> SkPicturePlayback, some of
the
> data structures get translated, but some just get copied across, and those
> copies are expensive enough to show up in the profiles. We'd like to just
> transfer ownership of the data structures where possible (to avoid the
copies),
> but the pieces of the API that copy-without-doing-an-endRecording() make that
a
> lot more complicated.
> 
> On reflection I'm not sure they *prevent* Ian's intended optimization, just
make
> it uglier, but he's got a finely developed aesthetic sense so we figured we'd
> put the API to the question.

Specifically, we'd like to move the ops stream instead of copying it.
Sign in to reply to this message.

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