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

Issue 4459041: [PDF] Refactor content stream creation in SkPDFDevice to support more xfermodes. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 2 months ago by Steve VanDeBogart
Modified:
13 years, 1 month ago
Reviewers:
Chris Guillory, reed1
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlecode.com/svn/trunk
Visibility:
Public.

Description

[PDF] Refactor content stream creation in SkPDFDevice to support more xfermodes. Instead of writing all drawing and state updates into the final content stream immediately, this change creates a new ContentEntry each time the transform, clip, or paint changes. Drawing is done into a stream in the ContentEntry. When the consumer asks for the content, we combine all the ContentEntries with appropriate updates to the state (clip, transform, paint) in between. This allows us to modify the clip even after a drawing has completed. It also lets us remove ContentEntries with no drawing. Further optimization can be done to better use the stack features of PDF, for now we follow the previous model of having a single clip followed by a single transform on the graphic state stack. Push rectangle logic into SkPDFUtil::AppendRectangle. Change private functions to adhere to coding standards. Committed: http://code.google.com/p/skia/source/detail?r=1269

Patch Set 1 #

Patch Set 2 : Pull SkClipStack changes into their own CL #

Total comments: 18

Patch Set 3 : Address comments #

Total comments: 24

Patch Set 4 : Address comments #

Total comments: 4

Patch Set 5 : Fix nits #

Patch Set 6 : minor bug fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+567 lines, -315 lines) Patch
M include/core/SkClipStack.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M include/pdf/SkPDFDevice.h View 1 2 3 4 5 chunks +41 lines, -44 lines 0 comments Download
M include/pdf/SkPDFUtils.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M src/core/SkClipStack.cpp View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M src/pdf/SkPDFDevice.cpp View 1 2 3 4 5 25 chunks +508 lines, -263 lines 0 comments Download
M src/pdf/SkPDFUtils.cpp View 1 2 3 1 chunk +8 lines, -6 lines 0 comments Download

Messages

Total messages: 11
Steve VanDeBogart
This change doesn't add the new xfermode support, just make it possible.
13 years, 2 months ago (2011-05-02 19:04:17 UTC) #1
reed1
Can we submit the clipstack changes separately, and add a small unittest for the compare ...
13 years, 2 months ago (2011-05-02 20:34:43 UTC) #2
Steve VanDeBogart
On 2011/05/02 20:34:43, reed1 wrote: > Can we submit the clipstack changes separately, and add ...
13 years, 2 months ago (2011-05-02 21:01:22 UTC) #3
Steve VanDeBogart
On 2011/05/02 20:34:43, reed1 wrote: > Can we submit the clipstack changes separately, and add ...
13 years, 2 months ago (2011-05-03 03:39:25 UTC) #4
Chris Guillory
Some comments. Change adds complexity. I'd like to look at it again. http://codereview.appspot.com/4459041/diff/5001/include/pdf/SkPDFUtils.h File include/pdf/SkPDFUtils.h ...
13 years, 2 months ago (2011-05-04 19:27:50 UTC) #5
Steve VanDeBogart
http://codereview.appspot.com/4459041/diff/5001/include/pdf/SkPDFUtils.h File include/pdf/SkPDFUtils.h (right): http://codereview.appspot.com/4459041/diff/5001/include/pdf/SkPDFUtils.h#newcode51 include/pdf/SkPDFUtils.h:51: static void AppendRectangle(const SkRect& r, SkWStream* content); On 2011/05/04 ...
13 years, 2 months ago (2011-05-04 21:22:49 UTC) #6
Chris Guillory
LGTM. Some comments. http://codereview.appspot.com/4459041/diff/13001/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): http://codereview.appspot.com/4459041/diff/13001/include/pdf/SkPDFDevice.h#newcode154 include/pdf/SkPDFDevice.h:154: ContentEntry* fCurContentEntry; Optional: The Cur abbreviation ...
13 years, 1 month ago (2011-05-06 18:52:57 UTC) #7
Steve VanDeBogart
Chris, I pulled those functions into GraphicStackState, so you may want to give the diff ...
13 years, 1 month ago (2011-05-06 21:37:15 UTC) #8
Chris Guillory
LGTM. Cleaner. Couple of nits. http://codereview.appspot.com/4459041/diff/13001/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): http://codereview.appspot.com/4459041/diff/13001/include/pdf/SkPDFDevice.h#newcode154 include/pdf/SkPDFDevice.h:154: ContentEntry* fCurContentEntry; On 2011/05/06 ...
13 years, 1 month ago (2011-05-06 21:51:12 UTC) #9
Steve VanDeBogart
Thanks. http://codereview.appspot.com/4459041/diff/13001/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): http://codereview.appspot.com/4459041/diff/13001/include/pdf/SkPDFDevice.h#newcode154 include/pdf/SkPDFDevice.h:154: ContentEntry* fCurContentEntry; On 2011/05/06 21:51:13, Chris Guillory wrote: ...
13 years, 1 month ago (2011-05-07 01:59:27 UTC) #10
Steve VanDeBogart
13 years, 1 month ago (2011-05-09 07:55:13 UTC) #11
http://codereview.appspot.com/4459041/diff/13001/src/pdf/SkPDFDevice.cpp
File src/pdf/SkPDFDevice.cpp (right):

http://codereview.appspot.com/4459041/diff/13001/src/pdf/SkPDFDevice.cpp#newc...
src/pdf/SkPDFDevice.cpp:936: SkRect r = SkRect::MakeWH(this->width(),
this->height());
On 2011/05/06 21:37:15, Steve VanDeBogart wrote:
> On 2011/05/06 18:52:57, Chris Guillory wrote:
> > Can you add comment to explain this clip logic.
> 
> Done.

The comment and code didn't match, turns out that the comment was correct (r is
already in device space, no need to mapRect).  Corrected the code.
Sign in to reply to this message.

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