Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Issue 17113004: Replace SkPicture(SkStream) constructors with a factory. (Closed)

Created:
7 years, 6 months ago by scroggo
Modified:
7 years, 5 months ago
Reviewers:
robertphillips, reed1
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Replace SkPicture(SkStream) constructors with a factory. SkPicture: Remove the constructors which take an SkStream as an argument. Rather than having to check a variable for success, the factory will return NULL on failure. Add a protected function for determining if an SkStream is an SKP to share code with SkTimedPicture. In the factory, check for a NULL SkStream. Use a default decoder (from BUG: https://code.google.com/p/skia/issues/detail?id=1325) SkDebuggerGUI: Call SkPicture::CreateFromStream when necessary. Write a factory for creating SkTimedPictures and use it. Use the factory throughout tools. Add include/lazy to utils and effects gyp include_dirs so SkPicture.h can reference SkImageDecoder.h which references SkBitmapFactory.h (in include/lazy). Changes code Chromium uses, so this will require a temporary Skia and then a change to Chromium to use the new Skia code. TODO: Create a decoder that does nothing to be used by pinspect, lua pictures, etc, and allow it to not assert in SkOrderedReadBuffer. R=reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=9822

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Merge with latest #

Patch Set 4 : Remove dead function declaration. #

Total comments: 8

Patch Set 5 : respond to comments. #

Total comments: 4

Patch Set 6 : Respond to comments. #

Total comments: 2

Patch Set 7 : Remove a change in behavior #

Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -118 lines) Patch
M debugger/QT/SkDebuggerGUI.cpp View 1 2 3 4 5 6 5 chunks +25 lines, -37 lines 0 comments Download
M gm/gmmain.cpp View 1 2 1 chunk +1 line, -4 lines 0 comments Download
M gyp/effects.gyp View 2 chunks +2 lines, -0 lines 0 comments Download
M gyp/utils.gyp View 2 chunks +2 lines, -0 lines 0 comments Download
M include/core/SkPicture.h View 1 2 3 4 5 5 chunks +16 lines, -12 lines 0 comments Download
M samplecode/SampleApp.cpp View 1 chunk +4 lines, -2 lines 0 comments Download
M samplecode/SamplePictFile.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPicture.cpp View 1 2 3 4 5 6 1 chunk +30 lines, -24 lines 0 comments Download
M src/core/SkPicturePlayback.cpp View 1 2 3 4 5 1 chunk +3 lines, -4 lines 0 comments Download
M tests/PictureTest.cpp View 1 chunk +2 lines, -3 lines 0 comments Download
M tools/bench_pictures_main.cpp View 1 chunk +5 lines, -6 lines 0 comments Download
M tools/filtermain.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tools/lua/lua_pictures.cpp View 1 2 1 chunk +1 line, -7 lines 0 comments Download
M tools/pinspect.cpp View 1 chunk +3 lines, -4 lines 0 comments Download
M tools/render_pdfs_main.cpp View 1 3 chunks +3 lines, -6 lines 0 comments Download
M tools/render_pictures_main.cpp View 2 chunks +8 lines, -7 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
scroggo
7 years, 6 months ago (2013-06-14 22:50:51 UTC) #1
scroggo
How does this API change sound? If we like it, I'll write up another change ...
7 years, 6 months ago (2013-06-24 16:58:46 UTC) #2
robertphillips
I like it. https://codereview.chromium.org/17113004/diff/8001/debugger/QT/SkDebuggerGUI.cpp File debugger/QT/SkDebuggerGUI.cpp (right): https://codereview.chromium.org/17113004/diff/8001/debugger/QT/SkDebuggerGUI.cpp#newcode250 debugger/QT/SkDebuggerGUI.cpp:250: Does it make sense for there ...
7 years, 6 months ago (2013-06-24 17:22:09 UTC) #3
scroggo
https://codereview.chromium.org/17113004/diff/8001/debugger/QT/SkDebuggerGUI.cpp File debugger/QT/SkDebuggerGUI.cpp (right): https://codereview.chromium.org/17113004/diff/8001/debugger/QT/SkDebuggerGUI.cpp#newcode250 debugger/QT/SkDebuggerGUI.cpp:250: On 2013/06/24 17:22:09, robertphillips wrote: > Does it make ...
7 years, 6 months ago (2013-06-24 18:22:19 UTC) #4
reed1
https://codereview.chromium.org/17113004/diff/16001/src/core/SkPicture.cpp File src/core/SkPicture.cpp (right): https://codereview.chromium.org/17113004/diff/16001/src/core/SkPicture.cpp#newcode268 src/core/SkPicture.cpp:268: if (NULL == stream || NULL == info) { ...
7 years, 6 months ago (2013-06-24 22:24:14 UTC) #5
scroggo
https://codereview.chromium.org/17113004/diff/16001/src/core/SkPicture.cpp File src/core/SkPicture.cpp (right): https://codereview.chromium.org/17113004/diff/16001/src/core/SkPicture.cpp#newcode268 src/core/SkPicture.cpp:268: if (NULL == stream || NULL == info) { ...
7 years, 6 months ago (2013-06-25 15:36:50 UTC) #6
reed1
lgtm w/ comment-request https://codereview.chromium.org/17113004/diff/26001/src/core/SkPicture.cpp File src/core/SkPicture.cpp (right): https://codereview.chromium.org/17113004/diff/26001/src/core/SkPicture.cpp#newcode279 src/core/SkPicture.cpp:279: if (!stream->readBool()) { // What is ...
7 years, 6 months ago (2013-06-25 15:40:10 UTC) #7
scroggo
https://codereview.chromium.org/17113004/diff/26001/src/core/SkPicture.cpp File src/core/SkPicture.cpp (right): https://codereview.chromium.org/17113004/diff/26001/src/core/SkPicture.cpp#newcode279 src/core/SkPicture.cpp:279: if (!stream->readBool()) { On 2013/06/25 15:40:10, reed1 wrote: > ...
7 years, 6 months ago (2013-06-25 16:54:34 UTC) #8
scroggo
7 years, 5 months ago (2013-06-28 21:32:06 UTC) #9
Message was sent while issue was closed.
Committed patchset #7 manually as r9822 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698