DescriptionChange SkCanvasState to use inheritance.
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
to SkCanvasState::version.
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
SkCanvas::getDeviceSize().
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.
NOTREECHECKS=true
BUG=b/15693384
Committed: https://skia.googlesource.com/skia/+/352c2181d15ed053c3b759f08ff1f51d50e2d3bb
Patch Set 1 #Patch Set 2 : Add an assert that the version is correct. #
Total comments: 6
Patch Set 3 : Specify the version of the bad SkCanvasState. #
Total comments: 2
Patch Set 4 : Remove virtual destructor; upcast for delete. #Patch Set 5 : Add a clarifying comment for the upcast. #Patch Set 6 : Assume that version is 1. #
Total comments: 4
Patch Set 7 : Build Android with SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG. #Patch Set 8 : Use unambiguous type for rowBytes. #Patch Set 9 : Fix CanvasStateTest. #Patch Set 10 : Remove CANVAS_STATE_VERSION. #Patch Set 11 : Update header's comments for clarity. #Patch Set 12 : Rebase . #Patch Set 13 : Fix Windows failures. #
Messages
Total messages: 25 (0 generated)
|