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

Issue 2584041: First pieces of SkPDFDevice. Supports: (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 1 month ago by Steve VanDeBogart
Modified:
14 years, 1 month ago
Reviewers:
agl
CC:
skia-review_googlegroups.com, James Hawkins, reed
Base URL:
http://skia.googlecode.com/svn/trunk
Visibility:
Public.

Description

First pieces of SkPDFDevice. Supports: Matrix transforms. Rendering bitmaps. Basic paint parameters. Rendering rectangles, points, lines, polygons. Render a paint to the page. Committed: http://code.google.com/p/skia/source/detail?r=614

Patch Set 1 #

Total comments: 16

Patch Set 2 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1256 lines, -6 lines) Patch
M include/core/SkDevice.h View 1 chunk +2 lines, -2 lines 0 comments Download
A include/pdf/SkPDFDevice.h View 1 1 chunk +155 lines, -0 lines 0 comments Download
A include/pdf/SkPDFGraphicState.h View 1 1 chunk +80 lines, -0 lines 0 comments Download
A include/pdf/SkPDFImage.h View 1 1 chunk +67 lines, -0 lines 0 comments Download
M include/pdf/SkPDFTypes.h View 1 chunk +21 lines, -0 lines 0 comments Download
A src/pdf/SkPDFDevice.cpp View 1 1 chunk +493 lines, -0 lines 0 comments Download
A src/pdf/SkPDFGraphicState.cpp View 1 1 chunk +163 lines, -0 lines 0 comments Download
A src/pdf/SkPDFImage.cpp View 1 1 chunk +248 lines, -0 lines 0 comments Download
M src/pdf/SkPDFStream.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M src/pdf/SkPDFTypes.cpp View 1 chunk +20 lines, -0 lines 0 comments Download
M src/pdf/pdf_files.mk View 1 chunk +3 lines, -0 lines 0 comments Download
M tests/PDFPrimitivesTest.cpp View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 3
Steve VanDeBogart
14 years, 1 month ago (2010-10-19 21:20:21 UTC) #1
agl
LGTM http://codereview.appspot.com/2584041/diff/1/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): http://codereview.appspot.com/2584041/diff/1/include/pdf/SkPDFDevice.h#newcode71 include/pdf/SkPDFDevice.h:71: virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t count, ...
14 years, 1 month ago (2010-10-19 21:39:57 UTC) #2
Steve VanDeBogart
14 years, 1 month ago (2010-10-20 01:03:09 UTC) #3
http://codereview.appspot.com/2584041/diff/1/include/pdf/SkPDFDevice.h
File include/pdf/SkPDFDevice.h (right):

http://codereview.appspot.com/2584041/diff/1/include/pdf/SkPDFDevice.h#newcode71
include/pdf/SkPDFDevice.h:71: virtual void drawPoints(const SkDraw&,
SkCanvas::PointMode mode, size_t count,
On 2010/10/19 21:39:57, agl wrote:
> 80 chars

Done.

http://codereview.appspot.com/2584041/diff/1/include/pdf/SkPDFDevice.h#newcode89
include/pdf/SkPDFDevice.h:89: virtual void drawVertices(const SkDraw&,
SkCanvas::VertexMode, int vertexCount,
On 2010/10/19 21:39:57, agl wrote:
> 80 chars

Done.

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

http://codereview.appspot.com/2584041/diff/1/src/pdf/SkPDFDevice.cpp#newcode53
src/pdf/SkPDFDevice.cpp:53: return SkString("S\n");
On 2010/10/19 21:39:57, agl wrote:
> I note that only one of these branches appends a newline.

Only (and all) branches that return append a newline

http://codereview.appspot.com/2584041/diff/1/src/pdf/SkPDFDevice.cpp#newcode127
src/pdf/SkPDFDevice.cpp:127: strokePath();
On 2010/10/19 21:39:57, agl wrote:
> Just a thought, if it's a polygon, does the caller expect us to close the
path?

I wondered the same thing.  The raster implementation does not.

http://codereview.appspot.com/2584041/diff/1/src/pdf/SkPDFDevice.cpp#newcode131
src/pdf/SkPDFDevice.cpp:131: for (size_t i = 1; i < count; i += 2) {
On 2010/10/19 21:39:57, agl wrote:
> I wonder if it wouldn't be smoother to read if the for loop went from 0 ...
> count/2 and the indexes has "* 2" below. Your call.

Done.

http://codereview.appspot.com/2584041/diff/1/src/pdf/SkPDFDevice.cpp#newcode331
src/pdf/SkPDFDevice.cpp:331: } while(0)
On 2010/10/19 21:39:57, agl wrote:
> indent two more spaces

Done.

http://codereview.appspot.com/2584041/diff/1/src/pdf/SkPDFGraphicState.cpp
File src/pdf/SkPDFGraphicState.cpp (right):

http://codereview.appspot.com/2584041/diff/1/src/pdf/SkPDFGraphicState.cpp#ne...
src/pdf/SkPDFGraphicState.cpp:40: SkTDArray<SkPDFGraphicState::GSCanonicalEntry>
On 2010/10/19 21:39:57, agl wrote:
> static initializers make DaveM cry. Can you not make them pointers and init on
> demand? Skia probably doesn't have support for pthread_once and friends, so
you
> might end up racing to create them, but that's fixable in the future.

I changed these to static methods with static varibles, which seems to do the
right thing with recent gcc versions, (see --fno-threadsafe-statics) but is not
thread safe on Windows.  There doesn't seem to be a good solution on Windows.

http://codereview.appspot.com/2584041/diff/1/src/pdf/SkPDFImage.cpp
File src/pdf/SkPDFImage.cpp (right):

http://codereview.appspot.com/2584041/diff/1/src/pdf/SkPDFImage.cpp#newcode136
src/pdf/SkPDFImage.cpp:136: // Should this un-premultiply?
On 2010/10/19 21:39:57, agl wrote:
> For PDF? Probably. You should check.

Done.
Sign in to reply to this message.

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