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

Issue 4239061: [PDF] Add support for shaders. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by Steve VanDeBogart
Modified:
13 years, 3 months ago
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk
Visibility:
Public.

Description

[PDF] Add support for Shaders. - Shaders, or as they are referred to in PDF, patterns, are drawn in the coordinate system of the initial page, so when we canonicalize them, we have to consider the current transform and where they are constructed. - Image shaders are tiled by default, this makes repeat and mirror modes easy, but means we have to draw a pattern as large as the current clip to support clamp mode. - Gradient shaders are implemented with type 4 functions, which are basically small snippets of post script code. I've tried to make the code generation modular and heavily commented to make it easy to understand or expand. Committed: http://code.google.com/p/skia/source/detail?r=905

Patch Set 1 #

Total comments: 14

Patch Set 2 : Address comments. #

Patch Set 3 : Address comments (rest). #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+979 lines, -21 lines) Patch
M Makefile View 1 chunk +2 lines, -0 lines 0 comments Download
M include/pdf/SkPDFDevice.h View 1 2 3 chunks +3 lines, -0 lines 0 comments Download
A include/pdf/SkPDFShader.h View 1 2 1 chunk +110 lines, -0 lines 0 comments Download
M include/pdf/SkPDFStream.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M src/pdf/SkPDFCatalog.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M src/pdf/SkPDFDevice.cpp View 1 2 8 chunks +91 lines, -20 lines 0 comments Download
A src/pdf/SkPDFShader.cpp View 1 2 1 chunk +768 lines, -0 lines 2 comments Download
M src/pdf/pdf_files.mk View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 11
Steve VanDeBogart
13 years, 4 months ago (2011-03-06 06:19:17 UTC) #1
reed1
http://codereview.appspot.com/4239061/diff/1/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): http://codereview.appspot.com/4239061/diff/1/include/pdf/SkPDFDevice.h#newcode180 include/pdf/SkPDFDevice.h:180: void updateGSFromPaint(SkPaint newPaint, bool forText); Why are we forcing ...
13 years, 3 months ago (2011-03-07 16:53:45 UTC) #2
Steve VanDeBogart
http://codereview.appspot.com/4239061/diff/1/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): http://codereview.appspot.com/4239061/diff/1/include/pdf/SkPDFDevice.h#newcode180 include/pdf/SkPDFDevice.h:180: void updateGSFromPaint(SkPaint newPaint, bool forText); On 2011/03/07 16:53:46, reed1 ...
13 years, 3 months ago (2011-03-07 19:11:43 UTC) #3
reed1
On 2011/03/07 19:11:43, Steve VanDeBogart wrote: > http://codereview.appspot.com/4239061/diff/1/include/pdf/SkPDFDevice.h > File include/pdf/SkPDFDevice.h (right): > > http://codereview.appspot.com/4239061/diff/1/include/pdf/SkPDFDevice.h#newcode180 ...
13 years, 3 months ago (2011-03-07 19:22:52 UTC) #4
reed1
On 2011/03/07 19:22:52, reed1 wrote: > On 2011/03/07 19:11:43, Steve VanDeBogart wrote: > > http://codereview.appspot.com/4239061/diff/1/include/pdf/SkPDFDevice.h ...
13 years, 3 months ago (2011-03-07 19:29:37 UTC) #5
reed1
13 years, 3 months ago (2011-03-07 19:29:43 UTC) #6
Steve VanDeBogart
On 2011/03/07 19:22:52, reed1 wrote: > On 2011/03/07 19:11:43, Steve VanDeBogart wrote: > > http://codereview.appspot.com/4239061/diff/1/include/pdf/SkPDFDevice.h ...
13 years, 3 months ago (2011-03-07 22:20:47 UTC) #7
reed1
LGTM
13 years, 3 months ago (2011-03-08 12:54:52 UTC) #8
twiz1
I believe that this change broke the skia sample app on Windows. Fix incoming. http://codereview.appspot.com/4239061/diff/10001/src/pdf/SkPDFShader.cpp ...
13 years, 3 months ago (2011-03-09 20:23:05 UTC) #9
Steve VanDeBogart
http://codereview.appspot.com/4239061/diff/10001/src/pdf/SkPDFShader.cpp File src/pdf/SkPDFShader.cpp (right): http://codereview.appspot.com/4239061/diff/10001/src/pdf/SkPDFShader.cpp#newcode132 src/pdf/SkPDFShader.cpp:132: SkScalar colorData[info.fColorCount][kColorComponents]; On 2011/03/09 20:23:05, twiz1 wrote: > The ...
13 years, 3 months ago (2011-03-09 21:41:33 UTC) #10
twiz1
13 years, 3 months ago (2011-03-09 21:45:07 UTC) #11
On 2011/03/09 21:41:33, Steve VanDeBogart wrote:
> http://codereview.appspot.com/4239061/diff/10001/src/pdf/SkPDFShader.cpp
> File src/pdf/SkPDFShader.cpp (right):
> 
>
http://codereview.appspot.com/4239061/diff/10001/src/pdf/SkPDFShader.cpp#newc...
> src/pdf/SkPDFShader.cpp:132: SkScalar
> colorData[info.fColorCount][kColorComponents];
> On 2011/03/09 20:23:05, twiz1 wrote:
> > The use of dynamic stack-arrays here has broken the SampleApp  on windows. 
On
> > which platform was this code compiled?  GCC?  
> > 
> > I'll quickly submit a CL for review that replaces these with calls to
alloca.
> 
> Sorry about that, I thought I had removed those.  Looks like  there are two of
> these.  The one in interpolateColorCode can be changed to a static value -
that
> generality is never used.  Let me know if you want me to take care of this.

Thanks for the offer, Steve, but I beat you to it. = )

Please see CL: http://codereview.appspot.com/4270041/
Sign in to reply to this message.

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