Skia
2DGraphicsLibrary
|
This class draws a shadow of the object (possibly offset), and then draws the original object in its original position. More...
#include <SkBlurDrawLooper.h>
Classes | |
class | BlurDrawLooperContext |
Public Types | |
enum | BlurFlags { kNone_BlurFlag = 0x00, kIgnoreTransform_BlurFlag = 0x01, kOverrideColor_BlurFlag = 0x02, kHighQuality_BlurFlag = 0x04, kAll_BlurFlag = 0x07 } |
Public Types inherited from SkFlattenable | |
enum | Type { kSkColorFilter_Type, kSkDrawable_Type, kSkDrawLooper_Type, kSkImageFilter_Type, kSkMaskFilter_Type, kSkPathEffect_Type, kSkPixelRef_Type, kSkRasterizer_Type, kSkShader_Type, kSkUnused_Type, kSkXfermode_Type, kSkNormalSource_Type } |
typedef sk_sp< SkFlattenable >(* | Factory )(SkReadBuffer &) |
Public Member Functions | |
SkDrawLooper::Context * | makeContext (SkCanvas *, SkArenaAlloc *) const override |
Called right before something is being drawn. More... | |
Public Member Functions inherited from SkDrawLooper | |
bool | canComputeFastBounds (const SkPaint &paint) const |
The fast bounds functions are used to enable the paint to be culled early in the drawing pipeline. More... | |
void | computeFastBounds (const SkPaint &paint, const SkRect &src, SkRect *dst) const |
Public Member Functions inherited from SkFlattenable | |
virtual Factory | getFactory () const =0 |
Implement this to return a factory function pointer that can be called to recreate your class given a buffer (previously written to by your override of flatten(). | |
virtual const char * | getTypeName () const |
Returns the name of the object's class. More... | |
Public Member Functions inherited from SkRefCntBase | |
SkRefCntBase () | |
Default construct, initializing the reference count to 1. | |
virtual | ~SkRefCntBase () |
Destruct, asserting that the reference count is 1. | |
int32_t | getRefCnt () const |
Return the reference count. More... | |
void | validate () const |
bool | unique () const |
May return true if the caller is the only owner. More... | |
void | ref () const |
Increment the reference count. More... | |
void | unref () const |
Decrement the reference count. More... | |
Static Public Member Functions | |
static sk_sp< SkDrawLooper > | Make (SkColor color, SkScalar sigma, SkScalar dx, SkScalar dy, uint32_t flags=kNone_BlurFlag) |
Static Public Member Functions inherited from SkFlattenable | |
static Factory | NameToFactory (const char name[]) |
static const char * | FactoryToName (Factory) |
static bool | NameToType (const char name[], Type *type) |
static void | Register (const char name[], Factory, Type) |
Protected Member Functions | |
SkBlurDrawLooper (SkColor color, SkScalar sigma, SkScalar dx, SkScalar dy, uint32_t flags) | |
void | flatten (SkWriteBuffer &) const override |
Override this if your subclass needs to record data that it will need to recreate itself from its CreateProc (returned by getFactory()). | |
bool | asABlurShadow (BlurShadowRec *) const override |
If this looper can be interpreted as having two layers, such that. More... | |
Protected Member Functions inherited from SkRefCntBase | |
void | internal_dispose_restore_refcnt_to_1 () const |
Allow subclasses to call this if they've overridden internal_dispose so they can reset fRefCnt before the destructor is called or if they choose not to call the destructor (e.g. More... | |
Private Types | |
enum | State { kBeforeEdge, kAfterEdge, kDone } |
typedef SkDrawLooper | INHERITED |
Private Member Functions | |
void | init (SkScalar sigma, SkScalar dx, SkScalar dy, SkColor color, uint32_t flags) |
void | initEffects () |
Private Attributes | |
sk_sp< SkMaskFilter > | fBlur |
sk_sp< SkColorFilter > | fColorFilter |
SkScalar | fDx |
SkScalar | fDy |
SkScalar | fSigma |
SkColor | fBlurColor |
uint32_t | fBlurFlags |
This class draws a shadow of the object (possibly offset), and then draws the original object in its original position.
should there be an option to just draw the shadow/blur layer? webkit?
|
overrideprotectedvirtual |
If this looper can be interpreted as having two layers, such that.
If any of the above are not met, return false and ignore the BlurShadowRec parameter.
Reimplemented from SkDrawLooper.
|
overridevirtual |
Called right before something is being drawn.
Returns a Context whose next() method should be called until it returns false.
Implements SkDrawLooper.