From: mdelaney@apple.com Date: Tue, 7 Feb 2012 20:04:23 +0000 (+0000) Subject: Remove redundant checks in CanvasRenderingContext2D.cpp X-Git-Tag: 070512121124~13566 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9dec3281088dfcf0944cc37f05542d59dd869645;p=profile%2Fivi%2Fwebkit-efl.git 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): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106973 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 6661049..3f1615e 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,15 @@ +2012-02-07 Matthew Delaney + + 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 Crash in ContainerNode functions due to mutation events. diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp index 6a2b71d..e9b0d36 100644 --- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp +++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp @@ -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); }