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

Issue 1930103003: remove SkWriteBuffer::reserve() (Closed)

Created:
4 years, 7 months ago by mtklein_C
Modified:
4 years, 7 months ago
Reviewers:
Brian Osman, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

remove SkWriteBuffer::reserve() We're not using it for anything that we can't do using the clearer writeFoo()/readFoo() methods. The deletions in SkPictureFlat.{h,cpp} and BitmapHeapTest.cpp clean up dead code. This code has not been used for a long time. I happened to notice it because it was another caller of reserve() (in a terrifyingly hacking/interesting way that I bet we'll find I authored...) BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1930103003 Deleting APIs unused publicly. TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/1b5dd884546d35ff0909168cbfeafd7f53225a97

Patch Set 1 #

Patch Set 2 : Remove dead code and its tests. #

Patch Set 3 : More dead code. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -569 lines) Patch
M include/core/SkWriteBuffer.h View 1 chunk +0 lines, -2 lines 0 comments Download
M src/core/SkPaint.cpp View 1 2 4 chunks +18 lines, -55 lines 0 comments Download
M src/core/SkPictureFlat.h View 1 1 chunk +0 lines, -393 lines 0 comments Download
M src/core/SkPictureFlat.cpp View 1 1 chunk +0 lines, -25 lines 0 comments Download
D tests/BitmapHeapTest.cpp View 1 1 chunk +0 lines, -94 lines 0 comments Download

Messages

Total messages: 22 (11 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1930103003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1930103003/20001
4 years, 7 months ago (2016-04-28 21:57:54 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Ubuntu-GCC-x86_64-Release-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-x86_64-Release-Trybot/builds/8199)
4 years, 7 months ago (2016-04-28 21:59:08 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1930103003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1930103003/40001
4 years, 7 months ago (2016-04-28 22:02:09 UTC) #8
mtklein_C
4 years, 7 months ago (2016-04-28 22:06:39 UTC) #10
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-04-28 22:13:02 UTC) #12
reed1
Not saying we have to keep it, but it allows us to not have the ...
4 years, 7 months ago (2016-04-29 00:36:41 UTC) #14
Brian Osman
lgtm
4 years, 7 months ago (2016-04-29 13:04:46 UTC) #15
mtklein
On 2016/04/29 at 00:36:41, reed wrote: > Not saying we have to keep it, but ...
4 years, 7 months ago (2016-04-29 15:25:03 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1930103003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1930103003/40001
4 years, 7 months ago (2016-04-29 15:45:49 UTC) #19
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://skia.googlesource.com/skia/+/1b5dd884546d35ff0909168cbfeafd7f53225a97
4 years, 7 months ago (2016-04-29 15:46:44 UTC) #21
mtklein
4 years, 7 months ago (2016-04-29 16:11:05 UTC) #22
Message was sent while issue was closed.
On 2016/04/29 at 15:25:03, mtklein wrote:
> On 2016/04/29 at 00:36:41, reed wrote:
> > Not saying we have to keep it, but it allows us to not have the size/check N
times if the caller knows he's going to write N values. In my mind its a little
like allocating a (private) struct: call once to get the memory, and then
scribble into it.
> > 
> > That said, if we find it harder to read/maintain, we can remove it and wait
and see if another need arises in the future.
> 
> writeByteArray() can still handle this private struct use case.
> 
> The main reason I'm happy to get rid of reserve() is that it's the only call
that splits the write call in half with a pointer, letting you write the bytes
perhaps long after you allocated space for them.  Nothing needs that
delayed-write feature any more, and it constrains how we can correctly allocate
that memory.

Looking again, writeByteArray() is not quite the same... it also writes the
array size.  But I do agree, if we need this ability to write a private struct,
we can add it back, ideally as a single-step writeStruct(const void*, size_t).

Powered by Google App Engine
This is Rietveld 408576698