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

Issue 4496041: [PDF] Add support for SrcIn, SrcOut, DstIn, DstOut xfermodes. (Closed)

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

Description

[PDF] Add support for SrcIn, SrcOut, DstIn, DstOut xfermodes. This change uses the soft mask (aka soft clip) functionality of PDF to implement the xfermodes. It has to put existing content (dst) into a form xobject as well as putting the new (src) content into a different form xobject. It then draws one of them with the other as the soft mask. To accomplish this, we add a call to finishContentEntry after each call to setUpContentEntry - this is kind of a hack, but I don't see a better way to extract src. Unfortunately, soft mask is specified in the Graphic State PDF object (and not in the form xobject), so when handling one of these modes, we add a one time GS object to set the soft mask and invoke a simple GS to reset the soft mask when done. Committed: http://code.google.com/p/skia/source/detail?r=1320

Patch Set 1 #

Total comments: 24

Patch Set 2 : Address comments #

Total comments: 2

Patch Set 3 : Remove AutoContentEntry #

Patch Set 4 : nit #

Total comments: 6

Patch Set 5 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+243 lines, -43 lines) Patch
M include/pdf/SkPDFDevice.h View 1 2 4 chunks +5 lines, -0 lines 0 comments Download
M include/pdf/SkPDFGraphicState.h View 1 2 3 4 4 chunks +27 lines, -3 lines 0 comments Download
M include/pdf/SkPDFUtils.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M src/pdf/SkPDFDevice.cpp View 1 2 3 4 15 chunks +99 lines, -22 lines 0 comments Download
M src/pdf/SkPDFGraphicState.cpp View 1 7 chunks +96 lines, -18 lines 0 comments Download
M src/pdf/SkPDFUtils.cpp View 1 2 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 7
Steve VanDeBogart
13 years, 7 months ago (2011-05-06 18:09:11 UTC) #1
Steve VanDeBogart
ping
13 years, 7 months ago (2011-05-10 23:56:08 UTC) #2
reed1
some questions about ownership. Deferring to chris for PDF-ness of the change. http://codereview.appspot.com/4496041/diff/1/src/pdf/SkPDFGraphicState.cpp File src/pdf/SkPDFGraphicState.cpp ...
13 years, 7 months ago (2011-05-11 00:29:27 UTC) #3
Chris Guillory
http://codereview.appspot.com/4496041/diff/1/include/pdf/SkPDFGraphicState.h File include/pdf/SkPDFGraphicState.h (right): http://codereview.appspot.com/4496041/diff/1/include/pdf/SkPDFGraphicState.h#newcode66 include/pdf/SkPDFGraphicState.h:66: /** Get a graphic state that only unsets the ...
13 years, 7 months ago (2011-05-11 22:15:44 UTC) #4
Steve VanDeBogart
http://codereview.appspot.com/4496041/diff/1/include/pdf/SkPDFGraphicState.h File include/pdf/SkPDFGraphicState.h (right): http://codereview.appspot.com/4496041/diff/1/include/pdf/SkPDFGraphicState.h#newcode66 include/pdf/SkPDFGraphicState.h:66: /** Get a graphic state that only unsets the ...
13 years, 7 months ago (2011-05-12 17:51:39 UTC) #5
Chris Guillory
LGTM. Nits and general comment on AutoContentEntry. http://codereview.appspot.com/4496041/diff/7001/src/pdf/SkPDFDevice.cpp File src/pdf/SkPDFDevice.cpp (right): http://codereview.appspot.com/4496041/diff/7001/src/pdf/SkPDFDevice.cpp#newcode451 src/pdf/SkPDFDevice.cpp:451: class AutoContentEntry ...
13 years, 7 months ago (2011-05-12 19:03:09 UTC) #6
Steve VanDeBogart
13 years, 7 months ago (2011-05-13 03:50:22 UTC) #7
Committing this now.  Reed: happy to address further comment in a follow up CL.

http://codereview.appspot.com/4496041/diff/7001/src/pdf/SkPDFDevice.cpp
File src/pdf/SkPDFDevice.cpp (right):

http://codereview.appspot.com/4496041/diff/7001/src/pdf/SkPDFDevice.cpp#newco...
src/pdf/SkPDFDevice.cpp:451: class AutoContentEntry {
On 2011/05/12 19:03:09, Chris Guillory wrote:
> I think this class could be improved if it included more logic.
> * Convert setUpContentEntry and finishContentEntry into member functions
> * Make fDstFormXObject a member of this class.
> * Somehow integrate this class with fCurrentContentEntry (I'm not seeing a way
> immediately right now).
> 
> These changes are optional and may lead to suggestions orthogonal to this
> change. 

Yea, I can see that to a certain extent, but there's a lot of state modified in
SkPDFDevice by those functions.  I think I'll defer trying a more complete
solution.

http://codereview.appspot.com/4496041/diff/12001/include/pdf/SkPDFGraphicState.h
File include/pdf/SkPDFGraphicState.h (right):

http://codereview.appspot.com/4496041/diff/12001/include/pdf/SkPDFGraphicStat...
include/pdf/SkPDFGraphicState.h:66: /** Get a graphic state that only unsets the
soft mask.  The reference
On 2011/05/12 19:03:09, Chris Guillory wrote:
> Nit: One space between sentences to be consistent.

Done.

http://codereview.appspot.com/4496041/diff/12001/include/pdf/SkPDFGraphicStat...
include/pdf/SkPDFGraphicState.h:68: *  to unreference it when done.  This is
needed to accommodate the weak
On 2011/05/12 19:03:09, Chris Guillory wrote:
> Nit: One space between sentences. 

Done.

http://codereview.appspot.com/4496041/diff/12001/src/pdf/SkPDFDevice.cpp
File src/pdf/SkPDFDevice.cpp (right):

http://codereview.appspot.com/4496041/diff/12001/src/pdf/SkPDFDevice.cpp#newc...
src/pdf/SkPDFDevice.cpp:1049: cleanUp();
On 2011/05/12 19:03:09, Chris Guillory wrote:
> Nit: Comment here. Before you had "// Reset this device to have no content"

Done.
Sign in to reply to this message.

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