2 * Copyright 2014 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkDrawPictureCallback_DEFINED
9 #define SkDrawPictureCallback_DEFINED
14 * Subclasses of this can be passed to canvas.drawPicture(). During the drawing
15 * of the picture, this callback will periodically be invoked. If its
16 * abortDrawing() returns true, then picture playback will be interrupted.
18 * The resulting drawing is undefined, as there is no guarantee how often the
19 * callback will be invoked. If the abort happens inside some level of nested
20 * calls to save(), restore will automatically be called to return the state
21 * to the same level it was before the drawPicture call was made.
23 class SK_API SkDrawPictureCallback {
25 SkDrawPictureCallback() {}
26 virtual ~SkDrawPictureCallback() {}
28 virtual bool abortDrawing() = 0;
31 #endif//SkDrawPictureCallback_DEFINED