summaryrefslogtreecommitdiffstats
path: root/dom/canvas/CanvasRenderingContext2D.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-23 04:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-23 04:29:10 +0000
commite3cb9707d5a825c871111670200af02af1718195 (patch)
treee9b374d6a4dc9990a45e9b61098624f0b722ede1 /dom/canvas/CanvasRenderingContext2D.h
parentAdding debian version 125.0.1-2. (diff)
downloadfirefox-e3cb9707d5a825c871111670200af02af1718195.tar.xz
firefox-e3cb9707d5a825c871111670200af02af1718195.zip
Merging upstream version 125.0.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/canvas/CanvasRenderingContext2D.h')
-rw-r--r--dom/canvas/CanvasRenderingContext2D.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h
index 75a57ab14f..bfcbfccec2 100644
--- a/dom/canvas/CanvasRenderingContext2D.h
+++ b/dom/canvas/CanvasRenderingContext2D.h
@@ -364,14 +364,18 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
}
void ClosePath() {
- EnsureWritablePath();
+ if (!EnsureWritablePath()) {
+ return;
+ }
mPathBuilder->Close();
mPathPruned = false;
}
void MoveTo(double aX, double aY) {
- EnsureWritablePath();
+ if (!EnsureWritablePath()) {
+ return;
+ }
mozilla::gfx::Point pos(ToFloat(aX), ToFloat(aY));
if (!pos.IsFinite()) {
@@ -383,13 +387,17 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
}
void LineTo(double aX, double aY) {
- EnsureWritablePath();
+ if (!EnsureWritablePath()) {
+ return;
+ }
LineTo(mozilla::gfx::Point(ToFloat(aX), ToFloat(aY)));
}
void QuadraticCurveTo(double aCpx, double aCpy, double aX, double aY) {
- EnsureWritablePath();
+ if (!EnsureWritablePath()) {
+ return;
+ }
mozilla::gfx::Point cp1(ToFloat(aCpx), ToFloat(aCpy));
mozilla::gfx::Point cp2(ToFloat(aX), ToFloat(aY));
@@ -408,7 +416,9 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
void BezierCurveTo(double aCp1x, double aCp1y, double aCp2x, double aCp2y,
double aX, double aY) {
- EnsureWritablePath();
+ if (!EnsureWritablePath()) {
+ return;
+ }
BezierTo(mozilla::gfx::Point(ToFloat(aCp1x), ToFloat(aCp1y)),
mozilla::gfx::Point(ToFloat(aCp2x), ToFloat(aCp2y)),
@@ -680,7 +690,7 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
/* This function ensures there is a writable pathbuilder available
*/
- void EnsureWritablePath();
+ bool EnsureWritablePath();
// Ensures a path in UserSpace is available.
void EnsureUserSpacePath(