Modified: branches/safari-534.54-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (106836 => 106837)
--- branches/safari-534.54-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2012-02-06 20:54:13 UTC (rev 106836)
+++ branches/safari-534.54-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2012-02-06 20:56:38 UTC (rev 106837)
@@ -1320,38 +1320,31 @@
didDraw(normalizedDstRect);
}
-void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* canvas, float x, float y, ExceptionCode& ec)
+void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, float x, float y, ExceptionCode& ec)
{
- if (!canvas) {
+ if (!sourceCanvas) {
ec = TYPE_MISMATCH_ERR;
return;
}
- // In order to emulate drawing the result of toDataURL() into the canvas, we
- // need to deflate the size of the source rectangle by the source canvas's
- // backing store scale factor.
- // See https://www.w3.org/Bugs/Public/show_bug.cgi?id=15041 for motivation.
-
- FloatSize logicalSize = canvas->convertDeviceToLogical(canvas->size());
-
- drawImage(canvas, 0, 0, logicalSize.width(), logicalSize.height(), x, y, canvas->width(), canvas->height(), ec);
+ drawImage(sourceCanvas, 0, 0, sourceCanvas->width(), sourceCanvas->height(), x, y, sourceCanvas->width(), sourceCanvas->height(), ec);
}
-void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* canvas,
+void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas,
float x, float y, float width, float height, ExceptionCode& ec)
{
- if (!canvas) {
+ if (!sourceCanvas) {
ec = TYPE_MISMATCH_ERR;
return;
}
- drawImage(canvas, FloatRect(0, 0, canvas->width(), canvas->height()), FloatRect(x, y, width, height), ec);
+ drawImage(sourceCanvas, FloatRect(0, 0, sourceCanvas->width(), sourceCanvas->height()), FloatRect(x, y, width, height), ec);
}
-void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* canvas,
+void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas,
float sx, float sy, float sw, float sh,
float dx, float dy, float dw, float dh, ExceptionCode& ec)
{
- drawImage(canvas, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
+ drawImage(sourceCanvas, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
}
void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const FloatRect& srcRect,