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

Issue 1460503004: Add support for converting cc::Region to and from protobuf. (Closed)

Created:
5 years, 1 month ago by nyquist
Modified:
5 years ago
CC:
chromium-reviews, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@add-more-conversions
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add support for converting cc::Region to and from protobuf. For the (de)serialization of property trees and layers, we need to be able to serialize several data types and this CL adds conversions and a unit test for the cc::Region type. The conversion of cc::Region happens by serializing a list of gfx::Rect objects, and then on the deserialization side the union of the gfx::Rect objects are created to recreate the cc::Region. The initial version of this CL used writeToMemory and readFromMemory in Skia, and a suggestion was made to fix using uint8_t instead of char[], and this change still keeps this fix, even after those methods are not in use anymore. This is done in a separate CL to keep the logic-changing CLs clean and focused. BUG=538710 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/04b8bd2ea68f22f8051d9988e4872e51c4ab4409 Cr-Commit-Position: refs/heads/master@{#361302}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed comments from dtrainor #

Total comments: 3

Patch Set 3 : Rebased origin/master #

Patch Set 4 : Moved conversions to cc/proto. Using iterator and gfx::Rect instead of SkRegion. #

Patch Set 5 : Sad missing brackets #

Total comments: 2

Patch Set 6 : Added test for union of overlapping rects. Updated intersect-test to match. #

Total comments: 2

Patch Set 7 : Added a test for subtraction of overlapping rects #

Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -6 lines) Patch
M cc/BUILD.gn View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M cc/cc.gyp View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M cc/cc_tests.gyp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M cc/playback/clip_path_display_item.cc View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M cc/proto/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A cc/proto/cc_conversions.h View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
A cc/proto/cc_conversions.cc View 1 2 3 1 chunk +25 lines, -0 lines 0 comments Download
A cc/proto/cc_conversions_unittest.cc View 1 2 3 4 5 6 1 chunk +54 lines, -0 lines 0 comments Download
A + cc/proto/region.proto View 1 2 3 1 chunk +4 lines, -3 lines 0 comments Download

Messages

Total messages: 45 (15 generated)
nyquist
vmpstr, dtrainor: PTAL This ended up being a little bit weird DEPS-wise sadly.
5 years, 1 month ago (2015-11-19 02:05:11 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1460503004/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1460503004/1
5 years, 1 month ago (2015-11-19 02:08:05 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/79428) mac_chromium_compile_dbg_ng on ...
5 years, 1 month ago (2015-11-19 02:13:02 UTC) #6
David Trainor- moved to gerrit
nits https://chromiumcodereview.appspot.com/1460503004/diff/1/cc/base/DEPS File cc/base/DEPS (right): https://chromiumcodereview.appspot.com/1460503004/diff/1/cc/base/DEPS#newcode1 cc/base/DEPS:1: # Things within cc/base should not depend on ...
5 years, 1 month ago (2015-11-19 19:14:01 UTC) #7
nyquist
dtrainor: PTAL https://codereview.chromium.org/1460503004/diff/1/cc/base/DEPS File cc/base/DEPS (right): https://codereview.chromium.org/1460503004/diff/1/cc/base/DEPS#newcode1 cc/base/DEPS:1: # Things within cc/base should not depend ...
5 years, 1 month ago (2015-11-20 01:11:43 UTC) #8
David Trainor- moved to gerrit
lgtm with a few small checked_cast nits. https://chromiumcodereview.appspot.com/1460503004/diff/20001/cc/base/region.cc File cc/base/region.cc (right): https://chromiumcodereview.appspot.com/1460503004/diff/20001/cc/base/region.cc#newcode149 cc/base/region.cc:149: proto->set_skregion(buffer.get(), region_size); ...
5 years, 1 month ago (2015-11-20 21:46:50 UTC) #9
danakj
https://chromiumcodereview.appspot.com/1460503004/diff/20001/cc/base/region.h File cc/base/region.h (right): https://chromiumcodereview.appspot.com/1460503004/diff/20001/cc/base/region.h#newcode72 cc/base/region.h:72: void ToProtobuf(proto::Region* proto) const; I think we should treat ...
5 years, 1 month ago (2015-11-20 21:48:08 UTC) #10
David Trainor- moved to gerrit
On 2015/11/20 21:48:08, danakj (behind on reviews) wrote: > https://chromiumcodereview.appspot.com/1460503004/diff/20001/cc/base/region.h > File cc/base/region.h (right): > ...
5 years, 1 month ago (2015-11-20 21:52:32 UTC) #11
David Trainor- moved to gerrit
On 2015/11/20 21:52:32, David Trainor wrote: > On 2015/11/20 21:48:08, danakj (behind on reviews) wrote: ...
5 years, 1 month ago (2015-11-20 21:52:53 UTC) #12
danakj
On Fri, Nov 20, 2015 at 1:52 PM, <dtrainor@chromium.org> wrote: > On 2015/11/20 21:48:08, danakj ...
5 years, 1 month ago (2015-11-20 21:56:42 UTC) #13
nyquist
On 2015/11/20 21:56:42, danakj (behind on reviews) wrote: > On Fri, Nov 20, 2015 at ...
5 years, 1 month ago (2015-11-20 22:45:31 UTC) #14
vmpstr
On 2015/11/20 22:45:31, nyquist wrote: > On 2015/11/20 21:56:42, danakj (behind on reviews) wrote: > ...
5 years, 1 month ago (2015-11-20 23:10:52 UTC) #15
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1460503004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1460503004/60001
5 years, 1 month ago (2015-11-21 01:36:47 UTC) #18
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/82173)
5 years, 1 month ago (2015-11-21 02:42:53 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1460503004/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1460503004/80001
5 years ago (2015-11-23 17:30:30 UTC) #22
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years ago (2015-11-23 19:22:23 UTC) #24
nyquist
vmpstr (danakj): PTAL
5 years ago (2015-11-23 20:58:04 UTC) #25
vmpstr
https://codereview.chromium.org/1460503004/diff/80001/cc/proto/cc_conversions_unittest.cc File cc/proto/cc_conversions_unittest.cc (right): https://codereview.chromium.org/1460503004/diff/80001/cc/proto/cc_conversions_unittest.cc#newcode39 cc/proto/cc_conversions_unittest.cc:39: } If you have a region that's constructed as ...
5 years ago (2015-11-23 21:10:04 UTC) #26
nyquist
https://codereview.chromium.org/1460503004/diff/80001/cc/proto/cc_conversions_unittest.cc File cc/proto/cc_conversions_unittest.cc (right): https://codereview.chromium.org/1460503004/diff/80001/cc/proto/cc_conversions_unittest.cc#newcode39 cc/proto/cc_conversions_unittest.cc:39: } On 2015/11/23 21:10:04, vmpstr wrote: > If you ...
5 years ago (2015-11-23 22:31:29 UTC) #27
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1460503004/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1460503004/100001
5 years ago (2015-11-23 22:36:34 UTC) #29
vmpstr
lgtm https://codereview.chromium.org/1460503004/diff/100001/cc/proto/cc_conversions_unittest.cc File cc/proto/cc_conversions_unittest.cc (right): https://codereview.chromium.org/1460503004/diff/100001/cc/proto/cc_conversions_unittest.cc#newcode41 cc/proto/cc_conversions_unittest.cc:41: TEST(RegionTest, OverlappingRectUnionProtoConversion) { I'd also add one Region ...
5 years ago (2015-11-23 23:09:21 UTC) #30
nyquist
danakj: PTAL. I understand you're behind on reviews, so unless you disagree I plan on ...
5 years ago (2015-11-23 23:37:35 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1460503004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1460503004/120001
5 years ago (2015-11-23 23:44:06 UTC) #34
danakj
On Mon, Nov 23, 2015 at 3:37 PM, <nyquist@chromium.org> wrote: > danakj: PTAL. I understand ...
5 years ago (2015-11-23 23:46:50 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/133290)
5 years ago (2015-11-24 02:44:41 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1460503004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1460503004/120001
5 years ago (2015-11-24 03:50:44 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/133475)
5 years ago (2015-11-24 05:17:35 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1460503004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1460503004/120001
5 years ago (2015-11-24 09:27:57 UTC) #43
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years ago (2015-11-24 10:04:31 UTC) #44
commit-bot: I haz the power
5 years ago (2015-11-24 10:05:23 UTC) #45
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/04b8bd2ea68f22f8051d9988e4872e51c4ab4409
Cr-Commit-Position: refs/heads/master@{#361302}

Powered by Google App Engine
This is Rietveld 408576698