Title: [94606] branches/chromium/835/Source
Revision
94606
Author
[email protected]
Date
2011-09-06 15:36:05 -0700 (Tue, 06 Sep 2011)

Log Message

Merge http://trac.webkit.org/changeset/93131 : GraphicsContext3D should allow its hostWindow to be NULL .

Pass 0 to SharedGraphicsContext3D::create.

Merge definition of CanvasRenderingContext2D::paintsIntoCanvasBuffer from http://trac.webkit.org/changeset/93157 .

Chromium bug: http://code.google.com/p/chromium/issues/detail?id=94163

[email protected]
Review URL: http://codereview.chromium.org/7839014

Modified Paths

Diff

Modified: branches/chromium/835/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (94605 => 94606)


--- branches/chromium/835/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2011-09-06 22:29:44 UTC (rev 94605)
+++ branches/chromium/835/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2011-09-06 22:36:05 UTC (rev 94606)
@@ -191,9 +191,13 @@
 
 bool CanvasRenderingContext2D::paintsIntoCanvasBuffer() const
 {
-#if ENABLE(ACCELERATED_2D_CANVAS)
-    if (m_context3D)
-        return m_context3D->context()->paintsIntoCanvasBuffer();
+#if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING)
+    if (!isAccelerated())
+        return true;
+
+    RenderBox* renderBox = canvas()->renderBox();
+    if (renderBox && renderBox->hasLayer() && renderBox->layer()->hasAcceleratedCompositing())
+        return false;
 #endif
     return true;
 }
@@ -2047,8 +2051,7 @@
     }
 
     if (!m_context3D) {
-        Page* page = canvas()->document()->page();
-        m_context3D = SharedGraphicsContext3D::create(page->chrome());
+        m_context3D = SharedGraphicsContext3D::create(0);
         if (!m_context3D) {
             clearAcceleration();
             return;

Modified: branches/chromium/835/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp (94605 => 94606)


--- branches/chromium/835/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp	2011-09-06 22:29:44 UTC (rev 94605)
+++ branches/chromium/835/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp	2011-09-06 22:36:05 UTC (rev 94606)
@@ -51,6 +51,7 @@
 #include "WebViewImpl.h"
 
 #include <stdio.h>
+#include <wtf/Assertions.h>
 #include <wtf/FastMalloc.h>
 #include <wtf/text/CString.h>
 
@@ -122,10 +123,8 @@
         return false;
 
     Chrome* chrome = static_cast<Chrome*>(hostWindow);
-    m_webViewImpl = static_cast<WebKit::WebViewImpl*>(chrome->client()->webView());
+    m_webViewImpl = chrome ? static_cast<WebKit::WebViewImpl*>(chrome->client()->webView()) : 0;
 
-    if (!m_webViewImpl)
-        return false;
     if (!webContext->initialize(webAttributes, m_webViewImpl, renderDirectlyToHostWindow))
         return false;
     m_impl = webContext.release();
@@ -150,6 +149,7 @@
 
 Platform3DObject GraphicsContext3DInternal::platformTexture() const
 {
+    ASSERT(m_webViewImpl);
     m_impl->setParentContext(m_webViewImpl->graphicsContext3D());
     return m_impl->getPlatformTextureId();
 }
@@ -303,6 +303,7 @@
 bool GraphicsContext3DInternal::paintsIntoCanvasBuffer() const
 {
     // If the gpu compositor is on then skip the readback and software rendering path.
+    ASSERT(m_webViewImpl);
     return !m_webViewImpl->isAcceleratedCompositingActive();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to