2014-06-24 15:29:06 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkDrawPictureCallback_DEFINED
|
|
|
|
#define SkDrawPictureCallback_DEFINED
|
|
|
|
|
2014-09-03 18:04:30 +00:00
|
|
|
#include "SkTypes.h"
|
|
|
|
|
2015-01-07 15:28:41 +00:00
|
|
|
#ifdef SK_LEGACY_DRAWPICTURECALLBACK
|
|
|
|
#include "SkPicture.h"
|
|
|
|
|
2014-06-24 15:29:06 +00:00
|
|
|
/**
|
|
|
|
* Subclasses of this can be passed to canvas.drawPicture(). During the drawing
|
|
|
|
* of the picture, this callback will periodically be invoked. If its
|
|
|
|
* abortDrawing() returns true, then picture playback will be interrupted.
|
|
|
|
*
|
|
|
|
* The resulting drawing is undefined, as there is no guarantee how often the
|
|
|
|
* callback will be invoked. If the abort happens inside some level of nested
|
|
|
|
* calls to save(), restore will automatically be called to return the state
|
|
|
|
* to the same level it was before the drawPicture call was made.
|
|
|
|
*/
|
2015-01-07 15:28:41 +00:00
|
|
|
class SK_API SkDrawPictureCallback : public SkPicture::AbortCallback {
|
2014-06-24 15:29:06 +00:00
|
|
|
public:
|
2015-01-07 00:15:25 +00:00
|
|
|
virtual bool abortDrawing() = 0;
|
2015-01-07 15:28:41 +00:00
|
|
|
|
|
|
|
bool abort() SK_OVERRIDE { return this->abortDrawing(); }
|
2014-06-24 15:29:06 +00:00
|
|
|
};
|
2015-01-07 15:28:41 +00:00
|
|
|
#endif
|
2014-06-24 15:29:06 +00:00
|
|
|
|
2015-01-07 15:28:41 +00:00
|
|
|
#endif // SkDrawPictureCallback_DEFINED
|