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

Issue 568683002: use SkData::NewUninitialized (Closed)

Created:
6 years, 3 months ago by reed2
Modified:
6 years, 3 months ago
Reviewers:
bungeman-skia, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

use SkData::NewUninitialized BUG=skia:

Patch Set 1 #

Patch Set 2 : add SkStream::readIntoData #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -84 lines) Patch
M include/core/SkStream.h View 1 1 chunk +7 lines, -0 lines 2 comments Download
M src/core/SkPictureData.cpp View 1 2 chunks +8 lines, -9 lines 0 comments Download
M src/core/SkStream.cpp View 1 3 chunks +10 lines, -16 lines 0 comments Download
M src/images/SkDecodingImageGenerator.cpp View 1 1 chunk +3 lines, -5 lines 0 comments Download
M tests/MallocPixelRefTest.cpp View 3 chunks +5 lines, -12 lines 0 comments Download
M tests/SurfaceTest.cpp View 2 chunks +3 lines, -4 lines 0 comments Download
M tools/lua/lua_app.cpp View 1 1 chunk +4 lines, -7 lines 0 comments Download
M tools/lua/lua_pictures.cpp View 2 chunks +1 line, -12 lines 2 comments Download
M tools/skdiff_utils.cpp View 1 chunk +3 lines, -19 lines 0 comments Download

Messages

Total messages: 11 (4 generated)
reed2
6 years, 3 months ago (2014-09-12 03:00:45 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/568683002/20001
6 years, 3 months ago (2014-09-12 03:02:00 UTC) #4
commit-bot: I haz the power
Note for Reviewers: The CQ is waiting for an approval. If you believe that the ...
6 years, 3 months ago (2014-09-12 03:02:00 UTC) #5
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Please ask for an LGTM from a full ...
6 years, 3 months ago (2014-09-12 09:02:10 UTC) #7
bungeman-skia
Note also the existing implementations in SkStream.cpp which are declared in SkStreamPriv.h. https://codereview.chromium.org/568683002/diff/20001/include/core/SkStream.h File include/core/SkStream.h ...
6 years, 3 months ago (2014-09-12 14:50:27 UTC) #8
reed1
moved to https://codereview.chromium.org/565803005/
6 years, 3 months ago (2014-09-12 18:46:10 UTC) #10
reed1
6 years, 3 months ago (2014-09-12 18:55:17 UTC) #11
https://codereview.chromium.org/568683002/diff/20001/include/core/SkStream.h
File include/core/SkStream.h (right):

https://codereview.chromium.org/568683002/diff/20001/include/core/SkStream.h#...
include/core/SkStream.h:64: SkData* readIntoData(size_t size);
On 2014/09/12 14:50:27, bungeman1 wrote:
> Eck, not another thing on SkStream...
> 
> It seems like this might be better (both in implementation and use) as
> 
> SkData* SkData::NewFromStream(SkStream* stream, size_t length = SIZE_MAX)
> 
> This gets this away from being yet another helper on SkStream. Since this
isn't
> virtual and always just calls public api and makes a copy of the stream data
> anyway, it seems more clear that this is a SkData creator.
> 
> In the future this could even rely on a virtual 'SkData* refData()' which
would
> replace or augment getMemoryBase to not create a copy if the whole stream
needed
> to be duplicated into an SkData.
> 
> At the very least this would go into the readXXX non-virtual ghetto below.

Done.

https://codereview.chromium.org/568683002/diff/20001/tools/lua/lua_pictures.cpp
File tools/lua/lua_pictures.cpp (right):

https://codereview.chromium.org/568683002/diff/20001/tools/lua/lua_pictures.c...
tools/lua/lua_pictures.cpp:89: SkAutoDataUnref
data(SkData::NewFromFileName(FLAGS_luaFile[i]));
On 2014/09/12 14:50:27, bungeman1 wrote:
> Seems that you still need to test for non NULL data here (like lua_app.cpp)?
If
> not, then lua_app.cpp shouldn't have it either.

Done.

Powered by Google App Engine
This is Rietveld 408576698