#include <SkDrawLooper.h>
Inherits SkFlattenable.
Inherited by SkBlurDrawLooper, and SkLayerDrawLooper.
Public Member Functions | |
virtual void | init (SkCanvas *, SkPaint *) |
virtual bool | next () |
virtual void | restore () |
Protected Member Functions | |
SkDrawLooper () | |
SkDrawLooper (SkFlattenableReadBuffer &buffer) |
Subclasses of SkDrawLooper can be attached to a SkPaint. Where they are, and something is drawn to a canvas with that paint, the looper subclass will be called, allowing it to modify the canvas and/or paint for that draw call. More than that, via the next() method, the looper can modify the draw to be invoked multiple times (hence the name loop-er), allow it to perform effects like shadows or frame/fills, that require more than one pass.
Definition at line 35 of file SkDrawLooper.h.
SkDrawLooper::SkDrawLooper | ( | ) | [inline, protected] |
Definition at line 57 of file SkDrawLooper.h.
SkDrawLooper::SkDrawLooper | ( | SkFlattenableReadBuffer & | buffer | ) | [inline, protected] |
Definition at line 58 of file SkDrawLooper.h.
Called right before something is being drawn to the specified canvas with the specified paint. Subclass that want to modify either parameter can do so now.
Reimplemented in SkBlurDrawLooper, and SkLayerDrawLooper.
Definition at line 41 of file SkDrawLooper.h.
virtual bool SkDrawLooper::next | ( | ) | [inline, virtual] |
Called in a loop (after init()). Each time true is returned, the object is drawn (possibly with a modified canvas and/or paint). When false is finally returned, drawing for the object stops.
Reimplemented in SkBlurDrawLooper, and SkLayerDrawLooper.
Definition at line 46 of file SkDrawLooper.h.
virtual void SkDrawLooper::restore | ( | ) | [inline, virtual] |
Called after the looper has finally returned false from next(), allowing the looper to restore the canvas/paint to their original states. is this required, since the subclass knows when it is done??? should we pass the canvas/paint here, and/or to the next call so that subclasses don't need to retain pointers to them during the loop?
Reimplemented in SkBlurDrawLooper, and SkLayerDrawLooper.
Definition at line 54 of file SkDrawLooper.h.