Skip to content
Permalink
Browse files
Remove redundant checks in CanvasRenderingContext2D.cpp
https://bugs.webkit.org/show_bug.cgi?id=78000

Reviewed by Dan Bernstein.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setShadowColor):
(WebCore::CanvasRenderingContext2D::setShadow):
(WebCore::CanvasRenderingContext2D::drawImage):


Canonical link: https://commits.webkit.org/94890@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106973 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Matt Delaney committed Feb 7, 2012
1 parent ff2a426 commit b752f6f24acf9235ba873dd22c16d88feac359b6
Showing 2 changed files with 12 additions and 34 deletions.
@@ -1,3 +1,15 @@
2012-02-07 Matthew Delaney <mdelaney@apple.com>

Remove redundant checks in CanvasRenderingContext2D.cpp
https://bugs.webkit.org/show_bug.cgi?id=78000

Reviewed by Dan Bernstein.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setShadowColor):
(WebCore::CanvasRenderingContext2D::setShadow):
(WebCore::CanvasRenderingContext2D::drawImage):

2012-02-07 Abhishek Arya <inferno@chromium.org>

Crash in ContainerNode functions due to mutation events.
@@ -496,7 +496,6 @@ void CanvasRenderingContext2D::setShadowColor(const String& color)
{
if (!parseColorOrCurrentColor(state().m_shadowColor, color, canvas()))
return;

applyShadow();
}

@@ -1145,11 +1144,6 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
state().m_shadowOffset = FloatSize(width, height);
state().m_shadowBlur = blur;
state().m_shadowColor = makeRGBA32FromFloats(grayLevel, grayLevel, grayLevel, 1.0f);

GraphicsContext* c = drawingContext();
if (!c)
return;

applyShadow();
}

@@ -1163,11 +1157,6 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
state().m_shadowColor = colorWithOverrideAlpha(rgba, alpha);
state().m_shadowOffset = FloatSize(width, height);
state().m_shadowBlur = blur;

GraphicsContext* c = drawingContext();
if (!c)
return;

applyShadow();
}

@@ -1176,11 +1165,6 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
state().m_shadowOffset = FloatSize(width, height);
state().m_shadowBlur = blur;
state().m_shadowColor = makeRGBA32FromFloats(grayLevel, grayLevel, grayLevel, alpha);

GraphicsContext* c = drawingContext();
if (!c)
return;

applyShadow();
}

@@ -1189,11 +1173,6 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
state().m_shadowOffset = FloatSize(width, height);
state().m_shadowBlur = blur;
state().m_shadowColor = makeRGBA32FromFloats(r, g, b, a);

GraphicsContext* c = drawingContext();
if (!c)
return;

applyShadow();
}

@@ -1294,10 +1273,6 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image,
float sx, float sy, float sw, float sh,
float dx, float dy, float dw, float dh, ExceptionCode& ec)
{
if (!image) {
ec = TYPE_MISMATCH_ERR;
return;
}
drawImage(image, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
}

@@ -1366,21 +1341,12 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec

void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, float x, float y, ExceptionCode& ec)
{
if (!sourceCanvas) {
ec = TYPE_MISMATCH_ERR;
return;
}

drawImage(sourceCanvas, 0, 0, sourceCanvas->width(), sourceCanvas->height(), x, y, sourceCanvas->width(), sourceCanvas->height(), ec);
}

void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas,
float x, float y, float width, float height, ExceptionCode& ec)
{
if (!sourceCanvas) {
ec = TYPE_MISMATCH_ERR;
return;
}
drawImage(sourceCanvas, FloatRect(0, 0, sourceCanvas->width(), sourceCanvas->height()), FloatRect(x, y, width, height), ec);
}

0 comments on commit b752f6f

Please sign in to comment.