https://bugs.webkit.org/show_bug.cgi?id=30073
authorcmarrin@apple.com <cmarrin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Jan 2010 23:09:22 +0000 (23:09 +0000)
committercmarrin@apple.com <cmarrin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Jan 2010 23:09:22 +0000 (23:09 +0000)
        Moved reshape to HTMLCanvasElement::reset and have it always
        set the size to the canvas width and height attrs.

        This is not testable with LayoutTests, so I instead added logic
        to the demo at:

        https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/demos/webkit/SpinningBox.html

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@53434 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/html/HTMLCanvasElement.cpp

index 2ac9129..36d1ba4 100644 (file)
@@ -1,3 +1,20 @@
+2010-01-18  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30073
+        Moved reshape to HTMLCanvasElement::reset and have it always
+        set the size to the canvas width and height attrs.
+
+        This is not testable with LayoutTests, so I instead added logic
+        to the demo at:
+
+        https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/demos/webkit/SpinningBox.html
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::reset):
+        (WebCore::HTMLCanvasElement::paint):
+
 2010-01-18  Alexey Proskuryakov  <ap@apple.com>
 
         Reviewed by Geoffrey Garen.
index 8c298c5..f55d680 100644 (file)
@@ -227,6 +227,11 @@ void HTMLCanvasElement::reset()
     IntSize oldSize = m_size;
     m_size = IntSize(w, h);
 
+#if ENABLE(3D_CANVAS)
+    if (m_context && m_context->is3d())
+        static_cast<WebGLRenderingContext*>(m_context.get())->reshape(width(), height());
+#endif
+
     bool hadImageBuffer = m_createdImageBuffer;
     m_createdImageBuffer = false;
     m_imageBuffer.clear();
@@ -255,7 +260,7 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r)
         return;
     
 #if ENABLE(3D_CANVAS)
-    WebGLRenderingContext* context3D = NULL;
+    WebGLRenderingContext* context3D = 0;
     if (m_context && m_context->is3d()) {
         context3D = static_cast<WebGLRenderingContext*>(m_context.get());
         context3D->beginPaint();
@@ -269,10 +274,8 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r)
     }
 
 #if ENABLE(3D_CANVAS)
-    if (context3D != NULL) {
-        context3D->reshape(r.width(), r.height());
+    if (context3D)
         context3D->endPaint();
-    }
 #endif
 }