Title: [124925] trunk/Source
Revision
124925
Author
[email protected]
Date
2012-08-07 15:01:42 -0700 (Tue, 07 Aug 2012)

Log Message

[chromium] Use WebCompositor interface in Platform API instead of CCProxy to query threaded compositor status
https://bugs.webkit.org/show_bug.cgi?id=93398

Reviewed by Adam Barth.

Source/Platform:

Adds thread status query interfaces to WebCompositor for WebKit code that wants to know if we are in threaded
mode.

* chromium/public/WebCompositor.h:
(WebCompositor):

Source/WebCore:

Converts non-compositor code that cares about threaded compositing status over to query WebCompositor instead of
CCProxy.

* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
* platform/chromium/support/WebCompositorImpl.cpp:
(WebKit):
(WebKit::WebCompositor::threadingEnabled):
(WebKit::WebCompositor::onCompositorThread):
(WebKit::WebCompositorImpl::threadingEnabled):
* platform/chromium/support/WebCompositorImpl.h:
(WebCompositorImpl):
* platform/graphics/chromium/Canvas2DLayerBridge.cpp:
(WebCore::Canvas2DLayerBridge::Canvas2DLayerBridge):
* platform/graphics/chromium/DrawingBufferChromium.cpp:
(WebCore::DrawingBuffer::DrawingBuffer):

Source/WebKit/chromium:

Converts non-compositor code that cares about threaded compositing status over to query WebCompositor instead of
CCProxy.

* src/WebMediaPlayerClientImpl.cpp:
(WebKit::WebMediaPlayerClientImpl::supportsType):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::composite):
(WebKit::WebViewImpl::scheduleAnimation):
(WebKit::WebViewImpl::scheduleComposite):

Modified Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (124924 => 124925)


--- trunk/Source/Platform/ChangeLog	2012-08-07 21:54:31 UTC (rev 124924)
+++ trunk/Source/Platform/ChangeLog	2012-08-07 22:01:42 UTC (rev 124925)
@@ -1,5 +1,18 @@
 2012-08-07  James Robinson  <[email protected]>
 
+        [chromium] Use WebCompositor interface in Platform API instead of CCProxy to query threaded compositor status
+        https://bugs.webkit.org/show_bug.cgi?id=93398
+
+        Reviewed by Adam Barth.
+
+        Adds thread status query interfaces to WebCompositor for WebKit code that wants to know if we are in threaded
+        mode.
+
+        * chromium/public/WebCompositor.h:
+        (WebCompositor):
+
+2012-08-07  James Robinson  <[email protected]>
+
         [chromium] Move WebCompositor interface into Platform API
         https://bugs.webkit.org/show_bug.cgi?id=93391
 

Modified: trunk/Source/Platform/chromium/public/WebCompositor.h (124924 => 124925)


--- trunk/Source/Platform/chromium/public/WebCompositor.h	2012-08-07 21:54:31 UTC (rev 124924)
+++ trunk/Source/Platform/chromium/public/WebCompositor.h	2012-08-07 22:01:42 UTC (rev 124925)
@@ -45,6 +45,9 @@
     // prior to calling initialize.
     WEBKIT_EXPORT static void initialize(WebThread*);
 
+    // Returns whether the compositor was initialized with threading enabled.
+    WEBKIT_EXPORT static bool threadingEnabled();
+
     // Shuts down the compositor. This must be called when all compositor data
     // types have been deleted. No compositor classes or methods should be used
     // after shutdown.

Modified: trunk/Source/WebCore/ChangeLog (124924 => 124925)


--- trunk/Source/WebCore/ChangeLog	2012-08-07 21:54:31 UTC (rev 124924)
+++ trunk/Source/WebCore/ChangeLog	2012-08-07 22:01:42 UTC (rev 124925)
@@ -1,3 +1,26 @@
+2012-08-07  James Robinson  <[email protected]>
+
+        [chromium] Use WebCompositor interface in Platform API instead of CCProxy to query threaded compositor status
+        https://bugs.webkit.org/show_bug.cgi?id=93398
+
+        Reviewed by Adam Barth.
+
+        Converts non-compositor code that cares about threaded compositing status over to query WebCompositor instead of
+        CCProxy.
+
+        * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
+        * platform/chromium/support/WebCompositorImpl.cpp:
+        (WebKit):
+        (WebKit::WebCompositor::threadingEnabled):
+        (WebKit::WebCompositor::onCompositorThread):
+        (WebKit::WebCompositorImpl::threadingEnabled):
+        * platform/chromium/support/WebCompositorImpl.h:
+        (WebCompositorImpl):
+        * platform/graphics/chromium/Canvas2DLayerBridge.cpp:
+        (WebCore::Canvas2DLayerBridge::Canvas2DLayerBridge):
+        * platform/graphics/chromium/DrawingBufferChromium.cpp:
+        (WebCore::DrawingBuffer::DrawingBuffer):
+
 2012-08-07  Anders Carlsson  <[email protected]>
 
         Knob slot animation is flipped

Modified: trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp (124924 => 124925)


--- trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp	2012-08-07 21:54:31 UTC (rev 124924)
+++ trunk/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp	2012-08-07 22:01:42 UTC (rev 124925)
@@ -35,7 +35,6 @@
 #include "RenderView.h"
 #include "ScrollbarThemeComposite.h"
 #include "WebScrollbarThemeGeometryNative.h"
-#include "cc/CCProxy.h"
 #include <public/WebScrollableLayer.h>
 #include <public/WebScrollbar.h>
 #include <public/WebScrollbarLayer.h>

Modified: trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp (124924 => 124925)


--- trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp	2012-08-07 21:54:31 UTC (rev 124924)
+++ trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp	2012-08-07 22:01:42 UTC (rev 124925)
@@ -46,6 +46,12 @@
 {
     WebCompositorImpl::initialize(implThread);
 }
+
+bool WebCompositor::threadingEnabled()
+{
+    return WebCompositorImpl::threadingEnabled();
+}
+
 void WebCompositor::shutdown()
 {
     WebCompositorImpl::shutdown();
@@ -84,6 +90,11 @@
         CCProxy::setImplThread(0);
 }
 
+bool WebCompositorImpl::threadingEnabled()
+{
+    return s_implThread;
+}
+
 bool WebCompositorImpl::initialized()
 {
     return s_initialized;

Modified: trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.h (124924 => 124925)


--- trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.h	2012-08-07 21:54:31 UTC (rev 124924)
+++ trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.h	2012-08-07 22:01:42 UTC (rev 124925)
@@ -49,6 +49,7 @@
 
     friend class WebCompositor;
     static void initialize(WebThread* implThread);
+    static bool threadingEnabled();
     static void shutdown();
 
     static bool s_initialized;

Modified: trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp (124924 => 124925)


--- trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp	2012-08-07 21:54:31 UTC (rev 124924)
+++ trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp	2012-08-07 22:01:42 UTC (rev 124925)
@@ -34,7 +34,7 @@
 #include "SkCanvas.h"
 #include "SkDeferredCanvas.h"
 #include "TraceEvent.h"
-#include "cc/CCProxy.h"
+#include <public/WebCompositor.h>
 #include <public/WebGraphicsContext3D.h>
 
 using WebKit::WebExternalTextureLayer;
@@ -74,7 +74,7 @@
     // deferred. What we should be doing is to use a smarter heuristic based
     // on GPU resource monitoring and other factors to chose between single
     // and double buffering.
-    , m_useDoubleBuffering(CCProxy::hasImplThread() && deferralMode == NonDeferred)
+    , m_useDoubleBuffering(WebKit::WebCompositor::threadingEnabled() && deferralMode == NonDeferred)
     , m_frontBufferTexture(0)
     , m_backBufferTexture(textureId)
     , m_size(size)
@@ -98,7 +98,7 @@
 
     m_layer = WebExternalTextureLayer::create(this);
     m_layer.setTextureId(textureId);
-    m_layer.setRateLimitContext(!CCProxy::hasImplThread() || m_useDoubleBuffering);
+    m_layer.setRateLimitContext(!WebKit::WebCompositor::threadingEnabled() || m_useDoubleBuffering);
 }
 
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp (124924 => 124925)


--- trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp	2012-08-07 21:54:31 UTC (rev 124924)
+++ trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp	2012-08-07 22:01:42 UTC (rev 124925)
@@ -36,8 +36,8 @@
 #include "Extensions3DChromium.h"
 #include "GraphicsContext3D.h"
 #include "GraphicsContext3DPrivate.h"
-#include "cc/CCProxy.h"
 #include <algorithm>
+#include <public/WebCompositor.h>
 #include <public/WebExternalTextureLayer.h>
 #include <public/WebExternalTextureLayerClient.h>
 #include <public/WebGraphicsContext3D.h>
@@ -81,7 +81,7 @@
     , m_fbo(0)
     , m_colorBuffer(0)
     , m_frontColorBuffer(0)
-    , m_separateFrontTexture(m_preserveDrawingBuffer == Preserve || CCProxy::implThread())
+    , m_separateFrontTexture(m_preserveDrawingBuffer == Preserve || WebKit::WebCompositor::threadingEnabled())
     , m_depthStencilBuffer(0)
     , m_depthBuffer(0)
     , m_stencilBuffer(0)

Modified: trunk/Source/WebKit/chromium/ChangeLog (124924 => 124925)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-07 21:54:31 UTC (rev 124924)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-07 22:01:42 UTC (rev 124925)
@@ -1,5 +1,22 @@
 2012-08-07  James Robinson  <[email protected]>
 
+        [chromium] Use WebCompositor interface in Platform API instead of CCProxy to query threaded compositor status
+        https://bugs.webkit.org/show_bug.cgi?id=93398
+
+        Reviewed by Adam Barth.
+
+        Converts non-compositor code that cares about threaded compositing status over to query WebCompositor instead of
+        CCProxy.
+
+        * src/WebMediaPlayerClientImpl.cpp:
+        (WebKit::WebMediaPlayerClientImpl::supportsType):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::composite):
+        (WebKit::WebViewImpl::scheduleAnimation):
+        (WebKit::WebViewImpl::scheduleComposite):
+
+2012-08-07  James Robinson  <[email protected]>
+
         [chromium] Move WebCompositor interface into Platform AP
         https://bugs.webkit.org/show_bug.cgi?id=93391
 

Modified: trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp (124924 => 124925)


--- trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp	2012-08-07 21:54:31 UTC (rev 124924)
+++ trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp	2012-08-07 22:01:42 UTC (rev 124925)
@@ -26,15 +26,14 @@
 #include "WebKit.h"
 #include "WebMediaPlayer.h"
 #include "WebViewImpl.h"
-#include "cc/CCProxy.h"
-#include "platform/WebCString.h"
-#include "platform/WebCanvas.h"
-#include "platform/WebKitPlatformSupport.h"
-#include "platform/WebRect.h"
-#include "platform/WebSize.h"
-#include "platform/WebString.h"
-#include "platform/WebURL.h"
+#include <public/Platform.h>
+#include <public/WebCString.h>
+#include <public/WebCanvas.h>
 #include <public/WebMimeRegistry.h>
+#include <public/WebRect.h>
+#include <public/WebSize.h>
+#include <public/WebString.h>
+#include <public/WebURL.h>
 
 #if USE(ACCELERATED_COMPOSITING)
 #include "RenderLayerCompositor.h"
@@ -841,14 +840,12 @@
 void WebMediaPlayerClientImpl::didReceiveFrame()
 {
     // No lock since this gets called on the client's thread.
-    ASSERT(CCProxy::isImplThread());
     m_videoFrameProviderClient->didReceiveFrame();
 }
 
 void WebMediaPlayerClientImpl::didUpdateMatrix(const float* matrix)
 {
     // No lock since this gets called on the client's thread.
-    ASSERT(CCProxy::isImplThread());
     m_videoFrameProviderClient->didUpdateMatrix(matrix);
 }
 

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (124924 => 124925)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-08-07 21:54:31 UTC (rev 124924)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-08-07 22:01:42 UTC (rev 124925)
@@ -148,13 +148,10 @@
 #include "WebTouchCandidatesInfo.h"
 #include "WebViewClient.h"
 #include "WheelEvent.h"
-#include "cc/CCProxy.h"
 #include "cc/CCSettings.h"
 #include "painting/GraphicsContextBuilder.h"
-#include "platform/WebKitPlatformSupport.h"
-#include "platform/WebString.h"
-#include "platform/WebVector.h"
 #include <public/Platform.h>
+#include <public/WebCompositor.h>
 #include <public/WebDragData.h>
 #include <public/WebFloatPoint.h>
 #include <public/WebGraphicsContext3D.h>
@@ -163,6 +160,8 @@
 #include <public/WebLayerTreeView.h>
 #include <public/WebPoint.h>
 #include <public/WebRect.h>
+#include <public/WebString.h>
+#include <public/WebVector.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/MainThread.h>
 #include <wtf/RefPtr.h>
@@ -1726,7 +1725,7 @@
 void WebViewImpl::composite(bool)
 {
 #if USE(ACCELERATED_COMPOSITING)
-    if (CCProxy::hasImplThread())
+    if (WebCompositor::threadingEnabled())
         m_layerTreeView.setNeedsRedraw();
     else {
         ASSERT(isAcceleratedCompositingActive());
@@ -3586,7 +3585,7 @@
 void WebViewImpl::scheduleAnimation()
 {
     if (isAcceleratedCompositingActive()) {
-        if (CCProxy::hasImplThread()) {
+        if (WebCompositor::threadingEnabled()) {
             ASSERT(!m_layerTreeView.isNull());
             m_layerTreeView.setNeedsAnimate();
         } else
@@ -3800,7 +3799,7 @@
 
 void WebViewImpl::scheduleComposite()
 {
-    ASSERT(!CCProxy::hasImplThread());
+    ASSERT(!WebCompositor::threadingEnabled());
     m_client->scheduleComposite();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to