Flutter Engine
The Flutter Engine
|
#include <SkShadowUtils.h>
Static Public Member Functions | |
static void | DrawShadow (SkCanvas *canvas, const SkPath &path, const SkPoint3 &zPlaneParams, const SkPoint3 &lightPos, SkScalar lightRadius, SkColor ambientColor, SkColor spotColor, uint32_t flags=SkShadowFlags::kNone_ShadowFlag) |
static bool | GetLocalBounds (const SkMatrix &ctm, const SkPath &path, const SkPoint3 &zPlaneParams, const SkPoint3 &lightPos, SkScalar lightRadius, uint32_t flags, SkRect *bounds) |
static void | ComputeTonalColors (SkColor inAmbientColor, SkColor inSpotColor, SkColor *outAmbientColor, SkColor *outSpotColor) |
Definition at line 38 of file SkShadowUtils.h.
|
static |
Helper routine to compute color values for one-pass tonal alpha.
inAmbientColor | Original ambient color |
inSpotColor | Original spot color |
outAmbientColor | Modified ambient color |
outSpotColor | Modified spot color |
Definition at line 478 of file SkShadowUtils.cpp.
|
static |
Draw an offset spot shadow and outlining ambient shadow for the given path using a disc light. The shadow may be cached, depending on the path type and canvas matrix. If the matrix is perspective or the path is volatile, it will not be cached.
canvas | The canvas on which to draw the shadows. |
path | The occluder used to generate the shadows. |
zPlaneParams | Values for the plane function which returns the Z offset of the occluder from the canvas based on local x and y values (the current matrix is not applied). |
lightPos | Generally, the 3D position of the light relative to the canvas plane. If kDirectionalLight_ShadowFlag is set, this specifies a vector pointing towards the light. |
lightRadius | Generally, the radius of the disc light. If DirectionalLight_ShadowFlag is set, this specifies the amount of blur when the occluder is at Z offset == 1. The blur will grow linearly as the Z value increases. |
ambientColor | The color of the ambient shadow. |
spotColor | The color of the spot shadow. |
flags | Options controlling opaque occluder optimizations, shadow appearance, and light position. See SkShadowFlags. |
Definition at line 559 of file SkShadowUtils.cpp.
|
static |
Generate bounding box for shadows relative to path. Includes both the ambient and spot shadow bounds.
ctm | Current transformation matrix to device space. |
path | The occluder used to generate the shadows. |
zPlaneParams | Values for the plane function which returns the Z offset of the occluder from the canvas based on local x and y values (the current matrix is not applied). |
lightPos | Generally, the 3D position of the light relative to the canvas plane. If kDirectionalLight_ShadowFlag is set, this specifies a vector pointing towards the light. |
lightRadius | Generally, the radius of the disc light. If DirectionalLight_ShadowFlag is set, this specifies the amount of blur when the occluder is at Z offset == 1. The blur will grow linearly as the Z value increases. |
flags | Options controlling opaque occluder optimizations, shadow appearance, and light position. See SkShadowFlags. |
bounds | Return value for shadow bounding box. |
Definition at line 572 of file SkShadowUtils.cpp.