SkClipStack::Element tweaks.
authorfmalita <fmalita@chromium.org>
Thu, 5 Jun 2014 19:40:07 +0000 (12:40 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 5 Jun 2014 19:40:07 +0000 (12:40 -0700)
commitc3b589a24eb4d567a906189f882c259ecf5c2f58
treeb685282e7cba61088e2cb08da7c13bff764878cf
parent5d3f9c765f18f35232176473909b667928fd4378
SkClipStack::Element tweaks.

(
This is intended to facilitate efficient kMatrix_SaveFlags emulation
on restore():

  * collect all clip stack elements for the current save count into a
    side clip stack
  * canvas.restore(everything)
  * replay the collected clip ops to restore the initial clip state
  => we restored the matrix but the clip state is unchanged
)

Two main changes:

  * expose the save count for SkClipStack::Element
  * expose a replay method for the same (logic relocated from
    SkCanvas::replayClips)

The SkCanvas::ClipVisitor shuffling is to enable forward decl
in SkClipStack.h (cannot fwdecl a nested class).

R=reed@google.com, robertphillips@google.com
TBR=reed@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/269693003
include/core/SkCanvas.h
include/core/SkClipStack.h
src/core/SkCanvas.cpp
src/core/SkClipStack.cpp