cc: PaintOp serialization

Desktop / Chromium - Adrienne Walker [chromium.org] - 5 July 2017 15:45 EDT

Adds basic support for serializing and deserializing paint ops.

This punts on a number of types related to Skia, including SkTypeface, SkTextBlob, PaintFlags/SkPaint internals, and SkImage/PaintImage. These will be supported in follow up patches either by adding Skia support directly (like SkPath has) or by replacing recording data structures (like PaintShader).

An original version of this patch optionally would sometimes cast the input buffer and return that, but for simplicity, this always writes a copy of the op into the output buffer. This eliminates a class of TOCTOU issues and we can rethink it later as needed for performance.

Bug: 737629 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel Change-Id: I5bf968fd160723064fb6dcbe87c620e4b3cb0104 Reviewed-on: https://chromium-review.googlesource.com/528359

27ae819 cc: PaintOp serialization
cc/paint/BUILD.gn | 4 +
cc/paint/paint_flags.h | 3 +
cc/paint/paint_op_buffer.cc | 869 +++++++++++++++++++++++++-
cc/paint/paint_op_buffer.h | 271 ++++++--
cc/paint/paint_op_buffer_unittest.cc | 1146 ++++++++++++++++++++++++++++++++++
cc/paint/paint_op_reader.cc | 128 ++++
cc/paint/paint_op_reader.h | 76 +++
cc/paint/paint_op_writer.cc | 104 +++
cc/paint/paint_op_writer.h | 71 +++
9 files changed, 2629 insertions(+), 43 deletions(-)

Upstream: git.chromium.org


  • Share