Change SkCanvasState to use inheritance.
Cherry-pick from master.
The base class, SkCanvasState, now holds the version, width, and
height. These fields will always be a necessary part of the class.
(Also add in some padding.)
The other fields, which may change, have been moved into the
subclass, SkCanvasState_v1. If/when the version changes, it will
correspond to a new subclass.
In SkCanvasStateUtils::CreateFromCanvasState, check the version on
the base class, then do a static_cast to the version corresponding
Remove CANVAS_STATE_VERSION, which is redundant with the version
specified by the subclass.
Use unambiguous type for rowBytes.
Build Android with SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG. This allows us
to run the full suite of CanvasState tests. It is also representative
of what will be used on Android by WebView.
Fix CanvasStateTest where it was broken inside ifdef'ed out code.
Use SkCanvas::getBaseLayerSize() instead of the deprecated
Update the comments in the header to be more clear. In particular,
an SkCanvasState can only be used to pass an SkCanvas' state to a
future version of Skia (or the same); not an older version.
Remail@example.com, firstname.lastname@example.org, email@example.com
Review URL: https://codereview.chromium.org/372003002
Review URL: https://codereview.chromium.org/396763002
2 files changed