Commit 26aac6e5 authored by Adrienne Walker's avatar Adrienne Walker Committed by Commit Bot

cc: Add some class level comments for PaintCanvas

Change-Id: Ib652cc3653bf278c2cb9267cad12d1ee93f63683
Reviewed-on: https://chromium-review.googlesource.com/c/1292725Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602048}
parent 808d5c17
......@@ -21,6 +21,19 @@ class PaintOpBuffer;
using PaintRecord = PaintOpBuffer;
// PaintCanvas is the cc/paint wrapper of SkCanvas. It has a more restricted
// interface than SkCanvas (trimmed back to only what Chrome uses). Its reason
// for existence is so that it can do custom serialization logic into a
// PaintOpBuffer which (unlike SkPicture) is mutable, handles image replacement,
// and can be serialized in custom ways (such as using the transfer cache).
//
// PaintCanvas is usually implemented by either:
// (1) SkiaPaintCanvas, which is backed by an SkCanvas, usually for rasterizing.
// (2) RecordPaintCanvas, which records paint commands into a PaintOpBuffer.
//
// SkiaPaintCanvas allows callers to go from PaintCanvas to SkCanvas (or
// PaintRecord to SkPicture), but this is a one way trip. There is no way to go
// from SkCanvas to PaintCanvas or from SkPicture back into PaintRecord.
class CC_PAINT_EXPORT PaintCanvas {
public:
PaintCanvas() {}
......
......@@ -315,7 +315,7 @@ SkNoDrawCanvas* RecordPaintCanvas::GetCanvas() {
return &*canvas_;
// Size the canvas to be large enough to contain the |recording_bounds|, which
// may not be positioned at th origin.
// may not be positioned at the origin.
SkIRect enclosing_rect = recording_bounds_.roundOut();
canvas_.emplace(enclosing_rect.right(), enclosing_rect.bottom());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment