Title: [106973] trunk/Source/WebCore
Revision
106973
Author
[email protected]
Date
2012-02-07 12:04:23 -0800 (Tue, 07 Feb 2012)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106972 => 106973)


--- trunk/Source/WebCore/ChangeLog	2012-02-07 20:01:42 UTC (rev 106972)
+++ trunk/Source/WebCore/ChangeLog	2012-02-07 20:04:23 UTC (rev 106973)
@@ -1,3 +1,15 @@
+2012-02-07  Matthew Delaney  <[email protected]>
+
+        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  <[email protected]>
 
         Crash in ContainerNode functions due to mutation events.

Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (106972 => 106973)


--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2012-02-07 20:01:42 UTC (rev 106972)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2012-02-07 20:04:23 UTC (rev 106973)
@@ -496,7 +496,6 @@
 {
     if (!parseColorOrCurrentColor(state().m_shadowColor, color, canvas()))
         return;
-
     applyShadow();
 }
 
@@ -1145,11 +1144,6 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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(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);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to