webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
#include <CanvasRenderingContext2D.h>
Public Types | |
enum | WindingRule { WindingRule::Nonzero, WindingRule::Evenodd } |
enum | ImageSmoothingQuality { ImageSmoothingQuality::Low, ImageSmoothingQuality::Medium, ImageSmoothingQuality::High } |
using | Style = Variant< String, RefPtr< CanvasGradient >, RefPtr< CanvasPattern > > |
Public Member Functions | |
CanvasRenderingContext2D (HTMLCanvasElement &, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode) | |
virtual | ~CanvasRenderingContext2D () |
float | lineWidth () const |
void | setLineWidth (float) |
String | lineCap () const |
void | setLineCap (const String &) |
String | lineJoin () const |
void | setLineJoin (const String &) |
float | miterLimit () const |
void | setMiterLimit (float) |
const Vector< float > & | getLineDash () const |
void | setLineDash (const Vector< float > &) |
const Vector< float > & | webkitLineDash () const |
void | setWebkitLineDash (const Vector< float > &) |
float | lineDashOffset () const |
void | setLineDashOffset (float) |
float | shadowOffsetX () const |
void | setShadowOffsetX (float) |
float | shadowOffsetY () const |
void | setShadowOffsetY (float) |
float | shadowBlur () const |
void | setShadowBlur (float) |
String | shadowColor () const |
void | setShadowColor (const String &) |
float | globalAlpha () const |
void | setGlobalAlpha (float) |
String | globalCompositeOperation () const |
void | setGlobalCompositeOperation (const String &) |
void | save () |
void | restore () |
void | commit () |
void | scale (float sx, float sy) |
void | rotate (float angleInRadians) |
void | translate (float tx, float ty) |
void | transform (float m11, float m12, float m21, float m22, float dx, float dy) |
void | setTransform (float m11, float m12, float m21, float m22, float dx, float dy) |
void | resetTransform () |
void | setStrokeColor (const String &color, std::optional< float > alpha=std::nullopt) |
void | setStrokeColor (float grayLevel, float alpha=1.0) |
void | setStrokeColor (float r, float g, float b, float a) |
void | setStrokeColor (float c, float m, float y, float k, float a) |
void | setFillColor (const String &color, std::optional< float > alpha=std::nullopt) |
void | setFillColor (float grayLevel, float alpha=1.0f) |
void | setFillColor (float r, float g, float b, float a) |
void | setFillColor (float c, float m, float y, float k, float a) |
void | beginPath () |
void | fill (WindingRule=WindingRule::Nonzero) |
void | stroke () |
void | clip (WindingRule=WindingRule::Nonzero) |
void | fill (DOMPath &, WindingRule=WindingRule::Nonzero) |
void | stroke (DOMPath &) |
void | clip (DOMPath &, WindingRule=WindingRule::Nonzero) |
bool | isPointInPath (float x, float y, WindingRule=WindingRule::Nonzero) |
bool | isPointInStroke (float x, float y) |
bool | isPointInPath (DOMPath &, float x, float y, WindingRule=WindingRule::Nonzero) |
bool | isPointInStroke (DOMPath &, float x, float y) |
void | clearRect (float x, float y, float width, float height) |
void | fillRect (float x, float y, float width, float height) |
void | strokeRect (float x, float y, float width, float height) |
void | setShadow (float width, float height, float blur, const String &color=String(), std::optional< float > alpha=std::nullopt) |
void | setShadow (float width, float height, float blur, float grayLevel, float alpha=1.0) |
void | setShadow (float width, float height, float blur, float r, float g, float b, float a) |
void | setShadow (float width, float height, float blur, float c, float m, float y, float k, float a) |
void | clearShadow () |
ExceptionOr< void > | drawImage (CanvasImageSource &&, float dx, float dy) |
ExceptionOr< void > | drawImage (CanvasImageSource &&, float dx, float dy, float dw, float dh) |
ExceptionOr< void > | drawImage (CanvasImageSource &&, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh) |
void | drawImageFromRect (HTMLImageElement &, float sx=0, float sy=0, float sw=0, float sh=0, float dx=0, float dy=0, float dw=0, float dh=0, const String &compositeOperation=emptyString()) |
void | setAlpha (float) |
void | setCompositeOperation (const String &) |
Style | strokeStyle () const |
void | setStrokeStyle (Style &&) |
Style | fillStyle () const |
void | setFillStyle (Style &&) |
ExceptionOr< Ref< CanvasGradient > > | createLinearGradient (float x0, float y0, float x1, float y1) |
ExceptionOr< Ref< CanvasGradient > > | createRadialGradient (float x0, float y0, float r0, float x1, float y1, float r1) |
ExceptionOr< RefPtr< CanvasPattern > > | createPattern (CanvasImageSource &&, const String &repetition) |
ExceptionOr< RefPtr< ImageData > > | createImageData (ImageData *) const |
ExceptionOr< RefPtr< ImageData > > | createImageData (float width, float height) const |
ExceptionOr< RefPtr< ImageData > > | getImageData (float sx, float sy, float sw, float sh) const |
ExceptionOr< RefPtr< ImageData > > | webkitGetImageDataHD (float sx, float sy, float sw, float sh) const |
void | putImageData (ImageData &, float dx, float dy) |
void | putImageData (ImageData &, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight) |
void | webkitPutImageDataHD (ImageData &, float dx, float dy) |
void | webkitPutImageDataHD (ImageData &, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight) |
void | drawFocusIfNeeded (Element &) |
void | drawFocusIfNeeded (DOMPath &, Element &) |
float | webkitBackingStorePixelRatio () const |
void | reset () |
String | font () const |
void | setFont (const String &) |
String | textAlign () const |
void | setTextAlign (const String &) |
String | textBaseline () const |
void | setTextBaseline (const String &) |
String | direction () const |
void | setDirection (const String &) |
void | fillText (const String &text, float x, float y, std::optional< float > maxWidth=std::nullopt) |
void | strokeText (const String &text, float x, float y, std::optional< float > maxWidth=std::nullopt) |
Ref< TextMetrics > | measureText (const String &text) |
LineCap | getLineCap () const |
LineJoin | getLineJoin () const |
bool | imageSmoothingEnabled () const |
void | setImageSmoothingEnabled (bool) |
ImageSmoothingQuality | imageSmoothingQuality () const |
void | setImageSmoothingQuality (ImageSmoothingQuality) |
bool | usesDisplayListDrawing () const |
void | setUsesDisplayListDrawing (bool flag) |
bool | tracksDisplayListReplay () const |
void | setTracksDisplayListReplay (bool) |
String | displayListAsText (DisplayList::AsTextFlags) const |
String | replayDisplayListAsText (DisplayList::AsTextFlags) const |
Public Member Functions inherited from WebCore::CanvasRenderingContext | |
virtual | ~CanvasRenderingContext () |
void | ref () |
void | deref () |
HTMLCanvasElement & | canvas () const |
virtual bool | isWebGL1 () const |
virtual bool | isWebGL2 () const |
bool | is3d () const |
virtual PlatformLayer * | platformLayer () const |
Public Member Functions inherited from WebCore::ScriptWrappable | |
JSDOMObject * | wrapper () const |
void | setWrapper (JSDOMObject *, JSC::WeakHandleOwner *, void *) |
void | clearWrapper (JSDOMObject *) |
JSDOMObject * | wrapper () const |
void | setWrapper (JSDOMObject *, JSC::WeakHandleOwner *, void *) |
void | clearWrapper (JSDOMObject *) |
Public Member Functions inherited from WebCore::CanvasPath | |
virtual | ~CanvasPath () |
void | closePath () |
void | moveTo (float x, float y) |
void | lineTo (float x, float y) |
void | quadraticCurveTo (float cpx, float cpy, float x, float y) |
void | bezierCurveTo (float cp1x, float cp1y, float cp2x, float cp2y, float x, float y) |
ExceptionOr< void > | arcTo (float x0, float y0, float x1, float y1, float radius) |
ExceptionOr< void > | arc (float x, float y, float r, float sa, float ea, bool anticlockwise) |
ExceptionOr< void > | ellipse (float x, float y, float radiusX, float radiusY, float rotation, float startAngle, float endAngled, bool anticlockwise) |
void | rect (float x, float y, float width, float height) |
Additional Inherited Members | |
Static Public Member Functions inherited from WebCore::ScriptWrappable | |
template<typename Derived > | |
static ptrdiff_t | offsetOfWrapper () |
template<typename Derived > | |
static ptrdiff_t | offsetOfWrapper () |
Protected Member Functions inherited from WebCore::CanvasRenderingContext | |
CanvasRenderingContext (HTMLCanvasElement &) | |
bool | wouldTaintOrigin (const CanvasPattern *) |
bool | wouldTaintOrigin (const HTMLCanvasElement *) |
bool | wouldTaintOrigin (const HTMLImageElement *) |
bool | wouldTaintOrigin (const HTMLVideoElement *) |
bool | wouldTaintOrigin (const URL &) |
template<class T > | |
void | checkOrigin (const T *arg) |
void | checkOrigin (const URL &) |
Protected Member Functions inherited from WebCore::ScriptWrappable | |
~ScriptWrappable () | |
~ScriptWrappable () | |
Protected Member Functions inherited from WebCore::CanvasPath | |
CanvasPath () | |
CanvasPath (const Path &path) | |
void | lineTo (FloatPoint) |
Protected Attributes inherited from WebCore::CanvasPath | |
Path | m_path |
using WebCore::CanvasRenderingContext2D::Style = Variant<String, RefPtr<CanvasGradient>, RefPtr<CanvasPattern> > |
CanvasRenderingContext2D::CanvasRenderingContext2D | ( | HTMLCanvasElement & | canvas, |
bool | usesCSSCompatibilityParseMode, | ||
bool | usesDashboardCompatibilityMode | ||
) |
|
virtual |
void CanvasRenderingContext2D::beginPath | ( | ) |
void CanvasRenderingContext2D::clearRect | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
void CanvasRenderingContext2D::clearShadow | ( | ) |
void CanvasRenderingContext2D::clip | ( | WindingRule | windingRule = WindingRule::Nonzero | ) |
void CanvasRenderingContext2D::clip | ( | DOMPath & | path, |
WindingRule | windingRule = WindingRule::Nonzero |
||
) |
|
inline |
ExceptionOr< RefPtr< ImageData > > CanvasRenderingContext2D::createImageData | ( | ImageData * | imageData | ) | const |
ExceptionOr< RefPtr< ImageData > > CanvasRenderingContext2D::createImageData | ( | float | width, |
float | height | ||
) | const |
ExceptionOr< Ref< CanvasGradient > > CanvasRenderingContext2D::createLinearGradient | ( | float | x0, |
float | y0, | ||
float | x1, | ||
float | y1 | ||
) |
ExceptionOr< RefPtr< CanvasPattern > > CanvasRenderingContext2D::createPattern | ( | CanvasImageSource && | image, |
const String & | repetition | ||
) |
ExceptionOr< Ref< CanvasGradient > > CanvasRenderingContext2D::createRadialGradient | ( | float | x0, |
float | y0, | ||
float | r0, | ||
float | x1, | ||
float | y1, | ||
float | r1 | ||
) |
String CanvasRenderingContext2D::direction | ( | ) | const |
String CanvasRenderingContext2D::displayListAsText | ( | DisplayList::AsTextFlags | flags | ) | const |
ExceptionOr< void > CanvasRenderingContext2D::drawImage | ( | CanvasImageSource && | image, |
float | dx, | ||
float | dy | ||
) |
ExceptionOr< void > CanvasRenderingContext2D::drawImage | ( | CanvasImageSource && | image, |
float | dx, | ||
float | dy, | ||
float | dw, | ||
float | dh | ||
) |
ExceptionOr< void > CanvasRenderingContext2D::drawImage | ( | CanvasImageSource && | image, |
float | sx, | ||
float | sy, | ||
float | sw, | ||
float | sh, | ||
float | dx, | ||
float | dy, | ||
float | dw, | ||
float | dh | ||
) |
void CanvasRenderingContext2D::drawImageFromRect | ( | HTMLImageElement & | imageElement, |
float | sx = 0 , |
||
float | sy = 0 , |
||
float | sw = 0 , |
||
float | sh = 0 , |
||
float | dx = 0 , |
||
float | dy = 0 , |
||
float | dw = 0 , |
||
float | dh = 0 , |
||
const String & | compositeOperation = emptyString() |
||
) |
void CanvasRenderingContext2D::fill | ( | WindingRule | windingRule = WindingRule::Nonzero | ) |
void CanvasRenderingContext2D::fill | ( | DOMPath & | path, |
WindingRule | windingRule = WindingRule::Nonzero |
||
) |
void CanvasRenderingContext2D::fillRect | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
CanvasRenderingContext2D::Style CanvasRenderingContext2D::fillStyle | ( | ) | const |
void CanvasRenderingContext2D::fillText | ( | const String & | text, |
float | x, | ||
float | y, | ||
std::optional< float > | maxWidth = std::nullopt |
||
) |
String CanvasRenderingContext2D::font | ( | ) | const |
ExceptionOr< RefPtr< ImageData > > CanvasRenderingContext2D::getImageData | ( | float | sx, |
float | sy, | ||
float | sw, | ||
float | sh | ||
) | const |
|
inline |
const Vector< float > & CanvasRenderingContext2D::getLineDash | ( | ) | const |
|
inline |
float CanvasRenderingContext2D::globalAlpha | ( | ) | const |
String CanvasRenderingContext2D::globalCompositeOperation | ( | ) | const |
bool CanvasRenderingContext2D::imageSmoothingEnabled | ( | ) | const |
auto CanvasRenderingContext2D::imageSmoothingQuality | ( | ) | const |
bool CanvasRenderingContext2D::isPointInPath | ( | float | x, |
float | y, | ||
WindingRule | windingRule = WindingRule::Nonzero |
||
) |
bool CanvasRenderingContext2D::isPointInPath | ( | DOMPath & | path, |
float | x, | ||
float | y, | ||
WindingRule | windingRule = WindingRule::Nonzero |
||
) |
bool CanvasRenderingContext2D::isPointInStroke | ( | float | x, |
float | y | ||
) |
bool CanvasRenderingContext2D::isPointInStroke | ( | DOMPath & | path, |
float | x, | ||
float | y | ||
) |
String CanvasRenderingContext2D::lineCap | ( | ) | const |
float CanvasRenderingContext2D::lineDashOffset | ( | ) | const |
String CanvasRenderingContext2D::lineJoin | ( | ) | const |
float CanvasRenderingContext2D::lineWidth | ( | ) | const |
Ref< TextMetrics > CanvasRenderingContext2D::measureText | ( | const String & | text | ) |
float CanvasRenderingContext2D::miterLimit | ( | ) | const |
void CanvasRenderingContext2D::putImageData | ( | ImageData & | data, |
float | dx, | ||
float | dy, | ||
float | dirtyX, | ||
float | dirtyY, | ||
float | dirtyWidth, | ||
float | dirtyHeight | ||
) |
String CanvasRenderingContext2D::replayDisplayListAsText | ( | DisplayList::AsTextFlags | flags | ) | const |
void CanvasRenderingContext2D::reset | ( | ) |
void CanvasRenderingContext2D::resetTransform | ( | ) |
void CanvasRenderingContext2D::restore | ( | ) |
void CanvasRenderingContext2D::rotate | ( | float | angleInRadians | ) |
|
inline |
void CanvasRenderingContext2D::scale | ( | float | sx, |
float | sy | ||
) |
void CanvasRenderingContext2D::setAlpha | ( | float | alpha | ) |
void CanvasRenderingContext2D::setFillColor | ( | const String & | color, |
std::optional< float > | alpha = std::nullopt |
||
) |
void CanvasRenderingContext2D::setFillColor | ( | float | grayLevel, |
float | alpha = 1.0f |
||
) |
void CanvasRenderingContext2D::setFillColor | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
void CanvasRenderingContext2D::setFillColor | ( | float | c, |
float | m, | ||
float | y, | ||
float | k, | ||
float | a | ||
) |
void CanvasRenderingContext2D::setFillStyle | ( | CanvasRenderingContext2D::Style && | style | ) |
void CanvasRenderingContext2D::setGlobalAlpha | ( | float | alpha | ) |
void CanvasRenderingContext2D::setImageSmoothingEnabled | ( | bool | enabled | ) |
void CanvasRenderingContext2D::setImageSmoothingQuality | ( | ImageSmoothingQuality | quality | ) |
void CanvasRenderingContext2D::setLineDashOffset | ( | float | offset | ) |
void CanvasRenderingContext2D::setLineWidth | ( | float | width | ) |
void CanvasRenderingContext2D::setMiterLimit | ( | float | limit | ) |
void CanvasRenderingContext2D::setShadow | ( | float | width, |
float | height, | ||
float | blur, | ||
const String & | color = String() , |
||
std::optional< float > | alpha = std::nullopt |
||
) |
void CanvasRenderingContext2D::setShadow | ( | float | width, |
float | height, | ||
float | blur, | ||
float | grayLevel, | ||
float | alpha = 1.0 |
||
) |
void CanvasRenderingContext2D::setShadow | ( | float | width, |
float | height, | ||
float | blur, | ||
float | r, | ||
float | g, | ||
float | b, | ||
float | a | ||
) |
void CanvasRenderingContext2D::setShadow | ( | float | width, |
float | height, | ||
float | blur, | ||
float | c, | ||
float | m, | ||
float | y, | ||
float | k, | ||
float | a | ||
) |
void CanvasRenderingContext2D::setShadowBlur | ( | float | blur | ) |
void CanvasRenderingContext2D::setShadowOffsetX | ( | float | x | ) |
void CanvasRenderingContext2D::setShadowOffsetY | ( | float | y | ) |
void CanvasRenderingContext2D::setStrokeColor | ( | const String & | color, |
std::optional< float > | alpha = std::nullopt |
||
) |
void CanvasRenderingContext2D::setStrokeColor | ( | float | grayLevel, |
float | alpha = 1.0 |
||
) |
void CanvasRenderingContext2D::setStrokeColor | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
void CanvasRenderingContext2D::setStrokeColor | ( | float | c, |
float | m, | ||
float | y, | ||
float | k, | ||
float | a | ||
) |
void CanvasRenderingContext2D::setStrokeStyle | ( | CanvasRenderingContext2D::Style && | style | ) |
void CanvasRenderingContext2D::setTracksDisplayListReplay | ( | bool | tracksDisplayListReplay | ) |
void CanvasRenderingContext2D::setTransform | ( | float | m11, |
float | m12, | ||
float | m21, | ||
float | m22, | ||
float | dx, | ||
float | dy | ||
) |
|
inline |
float CanvasRenderingContext2D::shadowBlur | ( | ) | const |
String CanvasRenderingContext2D::shadowColor | ( | ) | const |
float CanvasRenderingContext2D::shadowOffsetX | ( | ) | const |
float CanvasRenderingContext2D::shadowOffsetY | ( | ) | const |
void CanvasRenderingContext2D::stroke | ( | ) |
void CanvasRenderingContext2D::strokeRect | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
CanvasRenderingContext2D::Style CanvasRenderingContext2D::strokeStyle | ( | ) | const |
void CanvasRenderingContext2D::strokeText | ( | const String & | text, |
float | x, | ||
float | y, | ||
std::optional< float > | maxWidth = std::nullopt |
||
) |
String CanvasRenderingContext2D::textAlign | ( | ) | const |
String CanvasRenderingContext2D::textBaseline | ( | ) | const |
|
inline |
void CanvasRenderingContext2D::transform | ( | float | m11, |
float | m12, | ||
float | m21, | ||
float | m22, | ||
float | dx, | ||
float | dy | ||
) |
void CanvasRenderingContext2D::translate | ( | float | tx, |
float | ty | ||
) |
|
inline |
|
inline |
ExceptionOr< RefPtr< ImageData > > CanvasRenderingContext2D::webkitGetImageDataHD | ( | float | sx, |
float | sy, | ||
float | sw, | ||
float | sh | ||
) | const |
|
inline |
void CanvasRenderingContext2D::webkitPutImageDataHD | ( | ImageData & | data, |
float | dx, | ||
float | dy, | ||
float | dirtyX, | ||
float | dirtyY, | ||
float | dirtyWidth, | ||
float | dirtyHeight | ||
) |