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

Issue 1858323002: Enable flattening/unflattening with custom unflatten procs (Closed)

Created:
4 years, 8 months ago by msarett
Modified:
4 years, 8 months ago
Reviewers:
mtklein, djsollen, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@flattenable
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Enable flattening/unflattening with custom unflatten procs Now flattenables are serialized using a string name, so that flattenables do not necessarily need to be registered before serialization. They just need to override getTypeName(). Allows custom unflatten procs to be set on the SkReadBuffer. This is optional if the flattenable is registered, but otherwise must be called. This was split off from: https://codereview.chromium.org/1837913003/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1858323002 Committed: https://skia.googlesource.com/skia/+/a3b3b238f507a6ec7f43febc6bf0bb17e04e770f

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : #

Total comments: 4

Patch Set 4 : Rebase on delete of fNamedFactorySet from SkWriteBuffer #

Patch Set 5 : Avoid duping strings #

Total comments: 10

Patch Set 6 : Response to comments #

Patch Set 7 : Send only the index or the string - never both #

Total comments: 1

Patch Set 8 : Combine with isValidating case, delete kValidation_Flag #

Patch Set 9 : Cleanup #

Total comments: 4

Patch Set 10 : Verify that the ValidatingReadBuffer does not use factory pointers #

Patch Set 11 : Fix test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+272 lines, -65 lines) Patch
M include/core/SkFlattenable.h View 1 1 chunk +9 lines, -3 lines 0 comments Download
M include/core/SkWriteBuffer.h View 1 2 3 4 5 6 7 5 chunks +5 lines, -4 lines 0 comments Download
M src/core/SkFlattenableSerialization.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkReadBuffer.h View 1 2 3 4 5 6 7 8 9 5 chunks +40 lines, -0 lines 0 comments Download
M src/core/SkReadBuffer.cpp View 1 2 3 4 5 6 7 8 2 chunks +31 lines, -3 lines 0 comments Download
M src/core/SkValidatingReadBuffer.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M src/core/SkValidatingReadBuffer.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +50 lines, -20 lines 0 comments Download
M src/core/SkWriteBuffer.cpp View 1 2 3 4 5 6 7 1 chunk +34 lines, -28 lines 0 comments Download
M tests/BitmapHeapTest.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -2 lines 0 comments Download
A tests/FlattenableCustomFactory.cpp View 1 2 3 4 1 chunk +95 lines, -0 lines 0 comments Download
M tests/SerializationTest.cpp View 1 2 3 4 5 6 7 4 chunks +4 lines, -4 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 36 (15 generated)
msarett
4 years, 8 months ago (2016-04-05 18:00:44 UTC) #6
reed1
Moving getTypeName to be virtual seems a fine change. Always forcing us to flatten strings ...
4 years, 8 months ago (2016-04-06 11:37:12 UTC) #9
mtklein
On 2016/04/06 at 11:37:12, reed wrote: > Moving getTypeName to be virtual seems a fine ...
4 years, 8 months ago (2016-04-06 11:50:21 UTC) #10
reed1
I guess that is the question : how often do we flatten but not serialize ...
4 years, 8 months ago (2016-04-06 11:53:50 UTC) #11
mtklein
On 2016/04/06 at 11:53:50, reed wrote: > I guess that is the question : how ...
4 years, 8 months ago (2016-04-06 12:06:13 UTC) #12
reed1
I was just referring to the old distinction we had, where "serialize" implied cross-process, and ...
4 years, 8 months ago (2016-04-06 12:10:44 UTC) #13
msarett
Any thoughts now that https://codereview.chromium.org/1863013003/ has landed? I briefly discussed indexing strings to avoiding rewriting ...
4 years, 8 months ago (2016-04-11 14:55:23 UTC) #14
reed1
Since this CL will make our serialized size larger, I'd like to try also to ...
4 years, 8 months ago (2016-04-11 15:07:48 UTC) #15
msarett
PTAL. We now build a dictionary on reads and writes to avoid writing each name ...
4 years, 8 months ago (2016-04-19 18:03:50 UTC) #17
mtklein
https://codereview.chromium.org/1858323002/diff/140001/src/core/SkReadBuffer.cpp File src/core/SkReadBuffer.cpp (right): https://codereview.chromium.org/1858323002/diff/140001/src/core/SkReadBuffer.cpp#newcode362 src/core/SkReadBuffer.cpp:362: factory = getCustomFactory(name); this-> https://codereview.chromium.org/1858323002/diff/140001/src/core/SkReadBuffer.h File src/core/SkReadBuffer.h (right): https://codereview.chromium.org/1858323002/diff/140001/src/core/SkReadBuffer.h#newcode207 ...
4 years, 8 months ago (2016-04-19 18:14:55 UTC) #18
msarett
https://codereview.chromium.org/1858323002/diff/140001/src/core/SkReadBuffer.cpp File src/core/SkReadBuffer.cpp (right): https://codereview.chromium.org/1858323002/diff/140001/src/core/SkReadBuffer.cpp#newcode362 src/core/SkReadBuffer.cpp:362: factory = getCustomFactory(name); On 2016/04/19 18:14:55, mtklein wrote: > ...
4 years, 8 months ago (2016-04-19 18:55:52 UTC) #19
msarett
Here's an implementation of the alternative we discussed: always send a string or an index ...
4 years, 8 months ago (2016-04-20 17:21:00 UTC) #20
msarett
PTAL. I've combined with the isValidating() case in SkWriteBuffer, since the new approach is also ...
4 years, 8 months ago (2016-04-21 14:19:45 UTC) #23
reed1
lgtm w/ suggestions https://codereview.chromium.org/1858323002/diff/260001/src/core/SkValidatingReadBuffer.cpp File src/core/SkValidatingReadBuffer.cpp (right): https://codereview.chromium.org/1858323002/diff/260001/src/core/SkValidatingReadBuffer.cpp#newcode230 src/core/SkValidatingReadBuffer.cpp:230: uint8_t firstByte = this->peekByte(); Can we ...
4 years, 8 months ago (2016-04-22 15:06:08 UTC) #24
msarett
https://codereview.chromium.org/1858323002/diff/260001/src/core/SkValidatingReadBuffer.cpp File src/core/SkValidatingReadBuffer.cpp (right): https://codereview.chromium.org/1858323002/diff/260001/src/core/SkValidatingReadBuffer.cpp#newcode230 src/core/SkValidatingReadBuffer.cpp:230: uint8_t firstByte = this->peekByte(); On 2016/04/22 15:06:08, reed1 wrote: ...
4 years, 8 months ago (2016-04-22 18:54:09 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1858323002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1858323002/280001
4 years, 8 months ago (2016-04-22 18:54:58 UTC) #27
reed1
lgtm
4 years, 8 months ago (2016-04-22 18:56:50 UTC) #28
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot/builds/8006)
4 years, 8 months ago (2016-04-22 19:00:30 UTC) #30
msarett
This fails SkBitmapHeapTest because, under the new flattening strategy, there is more than one entry ...
4 years, 8 months ago (2016-04-22 19:23:07 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1858323002/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1858323002/300001
4 years, 8 months ago (2016-04-22 19:33:12 UTC) #34
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 19:43:11 UTC) #36
Message was sent while issue was closed.
Committed patchset #11 (id:300001) as
https://skia.googlesource.com/skia/+/a3b3b238f507a6ec7f43febc6bf0bb17e04e770f

Powered by Google App Engine
This is Rietveld 408576698