SkMaskFilter Class Reference

#include <SkMaskFilter.h>

Inherits SkFlattenable.

Inherited by SkEmbossMaskFilter, and SkKernel33ProcMaskFilter.

Collaboration diagram for SkMaskFilter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SkMaskFilter ()
virtual SkMask::Format getFormat ()=0
virtual bool filterMask (SkMask *dst, const SkMask &src, const SkMatrix &, SkIPoint *margin)
bool filterPath (const SkPath &devPath, const SkMatrix &devMatrix, const SkRegion &devClip, SkBounder *, SkBlitter *blitter)
virtual void flatten (SkFlattenableWriteBuffer &)

Protected Member Functions

 SkMaskFilter (SkFlattenableReadBuffer &)

Detailed Description

SkMaskFilter is the base class for object that perform transformations on an alpha-channel mask before drawing it. A subclass of SkMaskFilter may be installed into a SkPaint. Once there, each time a primitive is drawn, it is first scan converted into a SkMask::kA8_Format mask, and handed to the filter, calling its filterMask() method. If this returns true, then the new mask is used to render into the device.

Blur and emboss are implemented as subclasses of SkMaskFilter.

Definition at line 40 of file SkMaskFilter.h.


Constructor & Destructor Documentation

SkMaskFilter::SkMaskFilter (  )  [inline]

Definition at line 42 of file SkMaskFilter.h.

SkMaskFilter::SkMaskFilter ( SkFlattenableReadBuffer  )  [inline, protected]

Definition at line 75 of file SkMaskFilter.h.


Member Function Documentation

virtual bool SkMaskFilter::filterMask ( SkMask dst,
const SkMask src,
const SkMatrix ,
SkIPoint margin 
) [virtual]

Create a new mask by filter the src mask. If src.fImage == null, then do not allocate or create the dst image but do fill out the other fields in dstMask. If you do allocate a dst image, use SkMask::AllocImage() If this returns false, dst mask is ignored.

Parameters:
dst the result of the filter. If src.fImage == null, dst should not allocate its image
src the original image to be filtered.
matrix the CTM
margin if not null, return the buffer dx/dy need when calculating the effect. Used when drawing a clipped object to know how much larger to allocate the src before applying the filter. If returning false, ignore this parameter.
Returns:
true if the dst mask was correctly created.

Reimplemented in SkEmbossMaskFilter, and SkKernel33ProcMaskFilter.

bool SkMaskFilter::filterPath ( const SkPath devPath,
const SkMatrix devMatrix,
const SkRegion devClip,
SkBounder ,
SkBlitter blitter 
)

Helper method that, given a path in device space, will rasterize it into a kA8_Format mask and then call filterMask(). If this returns true, the specified blitter will be called to render that mask. Returns false if filterMask() returned false. This method is not exported to java.

virtual void SkMaskFilter::flatten ( SkFlattenableWriteBuffer  )  [inline, virtual]

Override this to write data specific to your subclass into the buffer, being sure to call your super-class' version first. This data will later be passed to your Factory function, returned by getFactory().

Reimplemented from SkFlattenable.

Reimplemented in SkEmbossMaskFilter, SkKernel33ProcMaskFilter, and SkKernel33MaskFilter.

Definition at line 72 of file SkMaskFilter.h.

virtual SkMask::Format SkMaskFilter::getFormat (  )  [pure virtual]

Returns the format of the resulting mask that this subclass will return when its filterMask() method is called.

Implemented in SkEmbossMaskFilter, and SkKernel33ProcMaskFilter.


The documentation for this class was generated from the following file:

Generated on Tue Oct 20 11:03:42 2009 for Skia by  doxygen 1.6.1