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

Issue 4231044: [PDF] Remove one copy of each content stream. (Closed)

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

Description

[PDF] Remove one copy of each content stream. Committed: http://code.google.com/p/skia/source/detail?r=856

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -17 lines) Patch
M include/pdf/SkPDFDevice.h View 1 chunk +3 lines, -2 lines 2 comments Download
M include/pdf/SkPDFPage.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/pdf/SkPDFDevice.cpp View 1 chunk +10 lines, -4 lines 0 comments Download
M src/pdf/SkPDFFormXObject.cpp View 1 chunk +3 lines, -5 lines 2 comments Download
M src/pdf/SkPDFPage.cpp View 1 chunk +3 lines, -5 lines 0 comments Download

Messages

Total messages: 3
Steve VanDeBogart
Thanks for all the thoughtful reviews today.
13 years, 4 months ago (2011-02-24 21:45:36 UTC) #1
reed1
LGTM http://codereview.appspot.com/4231044/diff/1/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): http://codereview.appspot.com/4231044/diff/1/include/pdf/SkPDFDevice.h#newcode138 include/pdf/SkPDFDevice.h:138: SkStream* content() const; Does your comment mean that ...
13 years, 4 months ago (2011-02-24 22:27:50 UTC) #2
Steve VanDeBogart
13 years, 4 months ago (2011-02-24 23:22:51 UTC) #3
http://codereview.appspot.com/4231044/diff/1/include/pdf/SkPDFDevice.h
File include/pdf/SkPDFDevice.h (right):

http://codereview.appspot.com/4231044/diff/1/include/pdf/SkPDFDevice.h#newcod...
include/pdf/SkPDFDevice.h:138: SkStream* content() const;
On 2011/02/24 22:27:52, reed1 wrote:
> Does your comment mean that the contents of the stream might change later on?
If
> so, we should say that (which is fine by me if that is efficient).

No, I just mean that content returns a new SkStream and the caller has to
unref() it when done.  I changed the comment to try to make it clearer.

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

http://codereview.appspot.com/4231044/diff/1/src/pdf/SkPDFFormXObject.cpp#new...
src/pdf/SkPDFFormXObject.cpp:33: fStream = new SkPDFStream(content.get());
On 2011/02/24 22:27:52, reed1 wrote:
> I'm OK with this pattern, as you use it a lot elsewhere, but is the following
> equivalent?
> 
> SkAutoUnref content(device->content());
> fStream = new SkPDFStream((SkStream*)content.get());
> 
> If it is, perhaps we should create SkAutoTUnref which takes a type, which
would
> eliminate the need for the cast above. I think I prefer it because it is only
2
> lines, and there is no need to have the explicit "foo->unref(); // SkRefPtr
> comment..." each time. Just a thought.

SGTM
Sign in to reply to this message.

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