#include <SkMaskFilterBase.h>
|
enum class | Type {
kBlur
, kEmboss
, kSDF
, kShader
,
kTable
} |
|
enum | Type {
kSkColorFilter_Type
, kSkBlender_Type
, kSkDrawable_Type
, kSkDrawLooper_Type
,
kSkImageFilter_Type
, kSkMaskFilter_Type
, kSkPathEffect_Type
, kSkShader_Type
} |
|
typedef sk_sp< SkFlattenable >(* | Factory) (SkReadBuffer &) |
|
Definition at line 45 of file SkMaskFilterBase.h.
◆ FilterReturn
Enumerator |
---|
kFalse_FilterReturn | |
kTrue_FilterReturn | |
kUnimplemented_FilterReturn | |
Definition at line 119 of file SkMaskFilterBase.h.
119 {
123 };
@ kUnimplemented_FilterReturn
◆ Type
Enumerator |
---|
kBlur | |
kEmboss | |
kSDF | |
kShader | |
kTable | |
Definition at line 68 of file SkMaskFilterBase.h.
68 {
70 kEmboss,
71 kSDF,
74 };
◆ SkMaskFilterBase()
SkMaskFilterBase::SkMaskFilterBase |
( |
| ) |
|
|
inlineprotected |
◆ asABlur()
bool SkMaskFilterBase::asABlur |
( |
BlurRec * |
| ) |
const |
|
virtual |
◆ asImageFilter()
◆ computeFastBounds()
void SkMaskFilterBase::computeFastBounds |
( |
const SkRect & |
src, |
|
|
SkRect * |
dest |
|
) |
| const |
|
virtual |
The fast bounds function is used to enable the paint to be culled early in the drawing pipeline. This function accepts the current bounds of the paint as its src param and the filter adjust those bounds using its current mask and returns the result using the dest param. Callers are allowed to provide the same struct for both src and dest so each implementation must accommodate that behavior.
The default impl calls filterMask with the src mask having no image, but subclasses may override this if they can compute the rect faster.
Reimplemented in SkBlurMaskFilterImpl, sktext::gpu::SDFMaskFilterImpl, and SkShaderMaskFilterImpl.
Definition at line 305 of file SkMaskFilter.cpp.
305 {
308
312 } else {
313 dst->set(srcM.fBounds);
314 }
315}
virtual bool filterMask(SkMaskBuilder *dst, const SkMask &src, const SkMatrix &, SkIPoint *margin) const =0
static const SkMatrix & I()
@ kA8_Format
8bits per pixel mask (e.g. antialiasing)
◆ filterMask()
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.
Implemented in SkTableMaskFilterImpl, SkBlurMaskFilterImpl, SkEmbossMaskFilter, SkShaderMaskFilterImpl, and sktext::gpu::SDFMaskFilterImpl.
◆ filterRectsToNine()
Override if your subclass can filter a rect, and return the answer as a ninepatch mask to be stretched over the returned outerRect. On success return kTrue_FilterReturn. On failure (e.g. out of memory) return kFalse_FilterReturn. If the normal filterMask() entry-point should be called (the default) return kUnimplemented_FilterReturn.
By convention, the caller will take the center rol/col from the returned mask as the slice it can replicate horizontally and vertically as we stretch the mask to fit inside outerRect. It is an error for outerRect to be smaller than the mask's bounds. This would imply that the width and height of the mask should be odd. This is not required, just that the caller will call mask.fBounds.centerX() and centerY() to find the strips that will be replicated.
Definition at line 300 of file SkMaskFilter.cpp.
◆ filterRRectToNine()
Similar to filterRectsToNine, except it performs the work on a round rect.
Definition at line 294 of file SkMaskFilter.cpp.
◆ GetFlattenableType()
◆ getFlattenableType()
◆ getFormat()
◆ type()
virtual Type SkMaskFilterBase::type |
( |
| ) |
const |
|
pure virtual |
◆ SkDraw
◆ SkDrawBase
The documentation for this class was generated from the following files: