Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(895)

Issue 396763002: Change SkCanvasState to use inheritance. (Closed)

Created:
6 years, 5 months ago by scroggo
Modified:
6 years, 5 months ago
Reviewers:
djsollen, mtklein, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@m37_2062
Visibility:
Public.

Description

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 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 R=reed@google.com, djsollen@google.com, mtklein@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/372003002 Committed: https://skia.googlesource.com/skia/+/20ee1ba

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -47 lines) Patch
M include/utils/SkCanvasStateUtils.h View 4 chunks +8 lines, -7 lines 0 comments Download
M src/utils/SkCanvasStateUtils.cpp View 10 chunks +52 lines, -40 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
scroggo
reed@, I assume I need your approval to check in to m37 branch?
6 years, 5 months ago (2014-07-15 19:38:51 UTC) #1
reed1
lgtm
6 years, 5 months ago (2014-07-15 19:39:22 UTC) #2
scroggo
The CQ bit was checked by scroggo@google.com
6 years, 5 months ago (2014-07-15 19:44:48 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/scroggo@google.com/396763002/1
6 years, 5 months ago (2014-07-15 19:45:55 UTC) #4
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-15 19:45:57 UTC) #5
commit-bot: I haz the power
Failed to apply patch for include/utils/SkCanvasStateUtils.h: While running git apply --index -p1; error: patch failed: ...
6 years, 5 months ago (2014-07-15 19:45:57 UTC) #6
scroggo
Committed patchset #1 manually as r20ee1ba.
6 years, 5 months ago (2014-07-15 20:05:01 UTC) #7
scroggo
6 years, 5 months ago (2014-07-15 20:05:38 UTC) #8
Message was sent while issue was closed.
On 2014/07/15 20:05:01, scroggo wrote:
> Committed patchset #1 manually as r20ee1ba.

The failure to land via CQ is expected, since the CQ can only
submit to master. Landed manually.

Powered by Google App Engine
This is Rietveld 408576698