Flutter Engine
The Flutter Engine
|
Classes | |
struct | DrawRectData |
Functions | |
static bool | clip_bounds_quick_reject (const SkIRect &clipBounds, const SkIRect &rect) |
static bool | draw_mask (skgpu::ganesh::SurfaceDrawContext *sdc, const GrClip *clip, const SkMatrix &viewMatrix, const SkIRect &maskBounds, GrPaint &&paint, GrSurfaceProxyView mask) |
static void | mask_release_proc (void *addr, void *) |
static sk_sp< SkData > | create_data (const SkIRect &drawRect, const SkIRect &origDevBounds) |
static SkIRect | extract_draw_rect_from_data (SkData *data, const SkIRect &origDevBounds) |
static GrSurfaceProxyView | sw_create_filtered_mask (GrRecordingContext *rContext, const SkMatrix &viewMatrix, const GrStyledShape &shape, const SkMaskFilter *filter, const SkIRect &unclippedDevShapeBounds, const SkIRect &clipBounds, SkIRect *drawRect, skgpu::UniqueKey *key) |
static std::unique_ptr< skgpu::ganesh::SurfaceDrawContext > | create_mask_GPU (GrRecordingContext *rContext, const SkIRect &maskRect, const SkMatrix &origViewMatrix, const GrStyledShape &shape, int sampleCnt) |
static bool | get_unclipped_shape_dev_bounds (const GrStyledShape &shape, const SkMatrix &matrix, SkIRect *devBounds) |
static bool | get_shape_and_clip_bounds (skgpu::ganesh::SurfaceDrawContext *sdc, const GrClip *clip, const GrStyledShape &shape, const SkMatrix &matrix, SkIRect *unclippedDevShapeBounds, SkIRect *devClipBounds) |
static bool | can_filter_mask (const SkMaskFilterBase *maskFilter, const GrStyledShape &shape, const SkIRect &devSpaceShapeBounds, const SkIRect &clipBounds, const SkMatrix &ctm, SkIRect *maskRect) |
static std::unique_ptr< GrFragmentProcessor > | create_profile_effect (GrRecordingContext *rContext, const SkRect &circle, float sigma, float *solidRadius, float *textureRadius) |
static std::unique_ptr< GrFragmentProcessor > | make_circle_blur (GrRecordingContext *context, const SkRect &circle, float sigma) |
static std::unique_ptr< GrFragmentProcessor > | make_rect_integral_fp (GrRecordingContext *rContext, float sixSigma) |
static std::unique_ptr< GrFragmentProcessor > | make_rect_blur (GrRecordingContext *context, const GrShaderCaps &caps, const SkRect &srcRect, const SkMatrix &viewMatrix, float transformedSigma) |
static void | make_blurred_rrect_key (skgpu::UniqueKey *key, const SkRRect &rrectToDraw, float xformedSigma) |
static bool | fillin_view_on_gpu (GrDirectContext *dContext, const GrSurfaceProxyView &lazyView, GrThreadSafeCache::Trampoline *trampoline, const SkRRect &rrectToDraw, const SkISize &dimensions, float xformedSigma) |
static GrSurfaceProxyView | create_mask_on_cpu (GrRecordingContext *rContext, const SkRRect &rrectToDraw, const SkISize &dimensions, float xformedSigma) |
static std::unique_ptr< GrFragmentProcessor > | find_or_create_rrect_blur_mask_fp (GrRecordingContext *rContext, const SkRRect &rrectToDraw, const SkISize &dimensions, float xformedSigma) |
static std::unique_ptr< GrFragmentProcessor > | make_rrect_blur (GrRecordingContext *context, float sigma, float xformedSigma, const SkRRect &srcRRect, const SkRRect &devRRect) |
static bool | direct_filter_mask (GrRecordingContext *context, const SkMaskFilterBase *maskFilter, skgpu::ganesh::SurfaceDrawContext *sdc, GrPaint &&paint, const GrClip *clip, const SkMatrix &viewMatrix, const GrStyledShape &shape) |
static bool | compute_key_and_clip_bounds (skgpu::UniqueKey *maskKey, SkIRect *boundsForClip, const GrCaps *caps, const SkMatrix &viewMatrix, bool inverseFilled, const SkMaskFilterBase *maskFilter, const GrStyledShape &shape, const SkIRect &unclippedDevShapeBounds, const SkIRect &devClipBounds) |
static GrSurfaceProxyView | filter_mask (GrRecordingContext *context, const SkMaskFilterBase *maskFilter, GrSurfaceProxyView srcView, GrColorType srcColorType, SkAlphaType srcAlphaType, const SkMatrix &ctm, const SkIRect &maskRect) |
static GrSurfaceProxyView | hw_create_filtered_mask (GrDirectContext *dContext, skgpu::ganesh::SurfaceDrawContext *sdc, const SkMatrix &viewMatrix, const GrStyledShape &shape, const SkMaskFilterBase *filter, const SkIRect &unclippedDevShapeBounds, const SkIRect &clipBounds, SkIRect *maskRect, skgpu::UniqueKey *key) |
static void | draw_shape_with_mask_filter (GrRecordingContext *rContext, skgpu::ganesh::SurfaceDrawContext *sdc, const GrClip *clip, GrPaint &&paint, const SkMatrix &viewMatrix, const SkMaskFilterBase *maskFilter, const GrStyledShape &origShape) |
bool | ComputeBlurredRRectParams (const SkRRect &srcRRect, const SkRRect &devRRect, SkScalar sigma, SkScalar xformedSigma, SkRRect *rrectToDraw, SkISize *widthHeight, SkScalar rectXs[kBlurRRectMaxDivisions], SkScalar rectYs[kBlurRRectMaxDivisions], SkScalar texXs[kBlurRRectMaxDivisions], SkScalar texYs[kBlurRRectMaxDivisions]) |
void | DrawShapeWithMaskFilter (GrRecordingContext *rContext, skgpu::ganesh::SurfaceDrawContext *sdc, const GrClip *clip, const GrStyledShape &shape, GrPaint &&paint, const SkMatrix &viewMatrix, const SkMaskFilter *mf) |
void | DrawShapeWithMaskFilter (GrRecordingContext *rContext, skgpu::ganesh::SurfaceDrawContext *sdc, const GrClip *clip, const SkPaint &paint, const SkMatrix &ctm, const GrStyledShape &shape) |
static void | convolve_gaussian_1d (skgpu::ganesh::SurfaceFillContext *sfc, GrSurfaceProxyView srcView, const SkIRect &srcSubset, SkIVector dstToSrcOffset, const SkIRect &dstRect, SkAlphaType srcAlphaType, Direction direction, int radius, float sigma, SkTileMode mode) |
static std::unique_ptr< skgpu::ganesh::SurfaceDrawContext > | convolve_gaussian_2d (GrRecordingContext *rContext, GrSurfaceProxyView srcView, GrColorType srcColorType, const SkIRect &srcBounds, const SkIRect &dstBounds, int radiusX, int radiusY, SkScalar sigmaX, SkScalar sigmaY, SkTileMode mode, sk_sp< SkColorSpace > finalCS, SkBackingFit dstFit) |
static std::unique_ptr< skgpu::ganesh::SurfaceDrawContext > | convolve_gaussian (GrRecordingContext *rContext, GrSurfaceProxyView srcView, GrColorType srcColorType, SkAlphaType srcAlphaType, SkIRect srcBounds, SkIRect dstBounds, Direction direction, int radius, float sigma, SkTileMode mode, sk_sp< SkColorSpace > finalCS, SkBackingFit fit) |
static std::unique_ptr< skgpu::ganesh::SurfaceDrawContext > | reexpand (GrRecordingContext *rContext, std::unique_ptr< skgpu::ganesh::SurfaceContext > src, const SkRect &srcBounds, SkISize dstSize, sk_sp< SkColorSpace > colorSpace, SkBackingFit fit) |
static std::unique_ptr< skgpu::ganesh::SurfaceDrawContext > | two_pass_gaussian (GrRecordingContext *rContext, GrSurfaceProxyView srcView, GrColorType srcColorType, SkAlphaType srcAlphaType, sk_sp< SkColorSpace > colorSpace, SkIRect srcBounds, SkIRect dstBounds, float sigmaX, float sigmaY, int radiusX, int radiusY, SkTileMode mode, SkBackingFit fit) |
std::unique_ptr< skgpu::ganesh::SurfaceDrawContext > | GaussianBlur (GrRecordingContext *rContext, GrSurfaceProxyView srcView, GrColorType srcColorType, SkAlphaType srcAlphaType, sk_sp< SkColorSpace > colorSpace, SkIRect dstBounds, SkIRect srcBounds, float sigmaX, float sigmaY, SkTileMode mode, SkBackingFit fit) |
Variables | |
static constexpr auto | kMaskOrigin = kTopLeft_GrSurfaceOrigin |
static constexpr auto | kBlurredRRectMaskOrigin = kTopLeft_GrSurfaceOrigin |
static constexpr int | kBlurRRectMaxDivisions = 6 |
Blur utilities.
|
static |
If we cannot create a FragmentProcess for a mask filter, we might have special logic for it here. That code path requires constructing a src mask as input. Since that is a potentially expensive operation, this function tests if filter_mask would succeed if the mask were to be created.
'maskRect' returns the device space portion of the mask that the filter needs. The mask passed into 'filter_mask' should have the same extent as 'maskRect' but be translated to the upper-left corner of the mask (i.e., (maskRect.fLeft, maskRect.fTop) appears at (0, 0) in the mask).
Logically, how this works is: can_filter_mask is called if (it returns true) the returned mask rect is used for quick rejecting the mask rect is used to generate the mask filter_mask is called to filter the mask
TODO: this should work as: if (can_filter_mask(devShape, ...)) // rect, rrect, drrect, path filter_mask(devShape, ...) this would hide the RRect special case and the mask generation
Definition at line 372 of file GrBlurUtils.cpp.
|
static |
Definition at line 99 of file GrBlurUtils.cpp.
|
static |
Definition at line 1136 of file GrBlurUtils.cpp.
bool GrBlurUtils::ComputeBlurredRRectParams | ( | const SkRRect & | srcRRect, |
const SkRRect & | devRRect, | ||
SkScalar | sigma, | ||
SkScalar | xformedSigma, | ||
SkRRect * | rrectToDraw, | ||
SkISize * | widthHeight, | ||
SkScalar | rectXs[kBlurRRectMaxDivisions], | ||
SkScalar | rectYs[kBlurRRectMaxDivisions], | ||
SkScalar | texXs[kBlurRRectMaxDivisions], | ||
SkScalar | texYs[kBlurRRectMaxDivisions] | ||
) |
This method computes all the parameters for drawing a partially occluded nine-patched blurred rrect mask: rrectToDraw - the integerized rrect to draw in the mask widthHeight - how large to make the mask (rrectToDraw will be centered in this coord system). rectXs, rectYs - the x & y coordinates of the covering geometry lattice texXs, texYs - the texture coordinate at each point in rectXs & rectYs It returns true if 'devRRect' is nine-patchable
Definition at line 1465 of file GrBlurUtils.cpp.
|
static |
Definition at line 1742 of file GrBlurUtils.cpp.
|
static |
Draws 'dstRect' into 'surfaceFillContext' evaluating a 1D Gaussian over 'srcView'. The src rect is 'dstRect' offset by 'dstToSrcOffset'. 'mode' and 'bounds' are applied to the src coords.
Definition at line 1627 of file GrBlurUtils.cpp.
|
static |
Definition at line 1667 of file GrBlurUtils.cpp.
|
static |
Definition at line 142 of file GrBlurUtils.cpp.
|
static |
Definition at line 249 of file GrBlurUtils.cpp.
|
static |
Definition at line 801 of file GrBlurUtils.cpp.
|
static |
Definition at line 418 of file GrBlurUtils.cpp.
|
static |
Try to directly render the mask filter into the target. Returns true if drawing was successful. If false is returned then paint is unmodified.
Definition at line 1009 of file GrBlurUtils.cpp.
|
static |
Definition at line 108 of file GrBlurUtils.cpp.
|
static |
Definition at line 1376 of file GrBlurUtils.cpp.
void GrBlurUtils::DrawShapeWithMaskFilter | ( | GrRecordingContext * | , |
skgpu::ganesh::SurfaceDrawContext * | , | ||
const GrClip * | , | ||
const GrStyledShape & | , | ||
GrPaint && | , | ||
const SkMatrix & | viewMatrix, | ||
const SkMaskFilter * | |||
) |
Draw a shape handling the mask filter. The mask filter is not optional. The GrPaint will be modified after return.
Definition at line 1546 of file GrBlurUtils.cpp.
void GrBlurUtils::DrawShapeWithMaskFilter | ( | GrRecordingContext * | , |
skgpu::ganesh::SurfaceDrawContext * | , | ||
const GrClip * | , | ||
const SkPaint & | , | ||
const SkMatrix & | , | ||
const GrStyledShape & | |||
) |
Draw a shape handling the mask filter if present.
Definition at line 1557 of file GrBlurUtils.cpp.
|
static |
Definition at line 151 of file GrBlurUtils.cpp.
|
static |
Definition at line 737 of file GrBlurUtils.cpp.
|
static |
This function is used to implement filters that require an explicit src mask. It should only be called if can_filter_mask returned true and the maskRect param should be the output from that call. Implementations are free to get the GrContext from the src texture in order to create additional textures and perform multiple passes.
Definition at line 1228 of file GrBlurUtils.cpp.
|
static |
Definition at line 819 of file GrBlurUtils.cpp.
std::unique_ptr< skgpu::ganesh::SurfaceDrawContext > GrBlurUtils::GaussianBlur | ( | GrRecordingContext * | , |
GrSurfaceProxyView | srcView, | ||
GrColorType | srcColorType, | ||
SkAlphaType | srcAlphaType, | ||
sk_sp< SkColorSpace > | srcColorSpace, | ||
SkIRect | dstBounds, | ||
SkIRect | srcBounds, | ||
float | sigmaX, | ||
float | sigmaY, | ||
SkTileMode | mode, | ||
SkBackingFit | fit = SkBackingFit::kApprox |
||
) |
Applies a 2D Gaussian blur to a given texture. The blurred result is returned as a surfaceDrawContext in case the caller wishes to draw into the result. The GrSurfaceOrigin of the result will watch the GrSurfaceOrigin of srcView. The output color type, color space, and alpha type will be the same as the src.
Note: one of sigmaX and sigmaY should be non-zero!
context | The GPU context |
srcView | The source to be blurred. |
srcColorType | The colorType of srcProxy |
srcAlphaType | The alphaType of srcProxy |
srcColorSpace | Color space of the source. |
dstBounds | The destination bounds, relative to the source texture. |
srcBounds | The source bounds, relative to the source texture's offset. No pixels will be sampled outside of this rectangle. |
sigmaX | The blur's standard deviation in X. |
sigmaY | The blur's standard deviation in Y. |
tileMode | The mode to handle samples outside bounds. |
fit | backing fit for the returned render target context |
Definition at line 2107 of file GrBlurUtils.cpp.
|
static |
Definition at line 331 of file GrBlurUtils.cpp.
|
static |
Definition at line 299 of file GrBlurUtils.cpp.
|
static |
Definition at line 1288 of file GrBlurUtils.cpp.
|
static |
Definition at line 715 of file GrBlurUtils.cpp.
|
static |
Definition at line 495 of file GrBlurUtils.cpp.
|
static |
Definition at line 577 of file GrBlurUtils.cpp.
|
static |
Definition at line 537 of file GrBlurUtils.cpp.
|
static |
Definition at line 891 of file GrBlurUtils.cpp.
|
static |
Definition at line 131 of file GrBlurUtils.cpp.
|
static |
Definition at line 1919 of file GrBlurUtils.cpp.
|
static |
Definition at line 160 of file GrBlurUtils.cpp.
|
static |
Definition at line 1980 of file GrBlurUtils.cpp.
|
staticconstexpr |
Definition at line 713 of file GrBlurUtils.cpp.
|
staticconstexpr |
Definition at line 39 of file GrBlurUtils.h.
|
staticconstexpr |
Definition at line 103 of file GrBlurUtils.cpp.