From 6be2aa9a251bf6022570a03140f956655b3ef1da Mon Sep 17 00:00:00 2001 From: reed Date: Tue, 18 Nov 2014 11:08:05 -0800 Subject: wip for drawables Idea: 1. in its mutable recording state, keep a table of drawables on the side, and store an index in the record list. 2. In "immediate-mode" draw, just call the clients drawable directly (need access to our private list to turn the stored index into a proc) 3. when we "snap", we replace the list of drawables with a list of (sub) pictures, and then during playback of the snapped picture, we invoke a private drawable which just calls "drawPicture" on the index'd subpicture. Review URL: https://codereview.chromium.org/727363003 --- samplecode/SampleArc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'samplecode/SampleArc.cpp') diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp index c9310d6dd6..a44eeb59ba 100644 --- a/samplecode/SampleArc.cpp +++ b/samplecode/SampleArc.cpp @@ -72,6 +72,12 @@ class ArcsView : public SampleView { paint.setColor(SK_ColorBLUE); canvas->drawArc(fR, 0, fSweep, false, paint); } + + SkRect onGetBounds() SK_OVERRIDE { + SkRect r(fR); + r.outset(2, 2); + return r; + } }; public: -- cgit v1.2.3