From 04b8bd2ea68f22f8051d9988e4872e51c4ab4409 Mon Sep 17 00:00:00 2001 From: nyquist Date: Tue, 24 Nov 2015 02:04:17 -0800 Subject: 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 Review URL: https://codereview.chromium.org/1460503004 Cr-Commit-Position: refs/heads/master@{#361302} --- cc/BUILD.gn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cc/BUILD.gn') diff --git a/cc/BUILD.gn b/cc/BUILD.gn index 8fd1828..3e5b0a2 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn @@ -313,6 +313,8 @@ component("cc") { "playback/largest_display_item.h", "playback/transform_display_item.cc", "playback/transform_display_item.h", + "proto/cc_conversions.cc", + "proto/cc_conversions.h", "proto/gfx_conversions.cc", "proto/gfx_conversions.h", "proto/skia_conversions.cc", @@ -796,6 +798,7 @@ test("cc_unittests") { "playback/display_item_list_unittest.cc", "playback/display_list_raster_source_unittest.cc", "playback/display_list_recording_source_unittest.cc", + "proto/cc_conversions_unittest.cc", "proto/gfx_conversions_unittest.cc", "proto/skia_conversions_unittest.cc", "quads/draw_polygon_unittest.cc", -- cgit v1.1