drawPatch

fun drawPatch(cubics: Array<Point>, colors: IntArray, texCoords: Array<Point>? = null, blendMode: BlendMode, paint: Paint): Canvas

Draws a Coons patch: the interpolation of four cubics with shared corners, associating a color, and optionally a texture SkPoint, with each corner.

Coons patch uses clip and Matrix, paint Shader, ColorFilter, alpha, ImageFilter, and BlendMode. If Shader is provided it is treated as Coons patch texture; BlendMode mode combines color colors and Shader if both are provided.

Point array cubics specifies four Path cubic starting at the top-left corner, in clockwise order, sharing every fourth point. The last Path cubic ends at the first point.

Color array color associates colors with corners in top-left, top-right, bottom-right, bottom-left order.C

If paint contains Shader, Point array texCoords maps Shader as texture to corners in top-left, top-right, bottom-right, bottom-left order. If texCoords is nullptr, Shader is mapped using positions (derived from cubics).

Return

this

Parameters

cubics

Path cubic array, sharing common points

colors

color array, one for each corner

texCoords

Point array of texture coordinates, mapping Shader to corners; may be null

blendMode

BlendMode for colors, and for Shader if paint has one

paint

Shader, ColorFilter, BlendMode, used to draw

See also