Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Unified Diff: webkit/support/webkit_support.cc

Issue 12385074: Remove WebCompositorSupport::initialize/shutdown dependency from webkit_support::CreateLayerTreeView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test_webkit_platform_support Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/support/webkit_support.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/support/webkit_support.cc
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index da6b4e6e7ef8bc05a8f84b3b537723509a98b657..44aa1f9265b5ca8abbcfe036b21c3306984fafe6 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -57,6 +57,7 @@
#include "webkit/glue/webkit_constants.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webkitplatformsupport_impl.h"
+#include "webkit/glue/webthread_impl.h"
#include "webkit/glue/weburlrequest_extradata_impl.h"
#include "webkit/gpu/test_context_provider_factory.h"
#include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
@@ -524,11 +525,33 @@ WebKit::WebGraphicsContext3D* CreateGraphicsContext3D(
}
static WebKit::WebLayerTreeView* CreateLayerTreeView(
- WebKit::WebLayerTreeViewImplForTesting::RenderingType type,
- DRTLayerTreeViewClient* client) {
+ LayerTreeViewType type,
+ DRTLayerTreeViewClient* client,
+ scoped_ptr<cc::Thread> compositor_thread) {
scoped_ptr<WebKit::WebLayerTreeViewImplForTesting> view(
new WebKit::WebLayerTreeViewImplForTesting(type, client));
+ if (!view->initialize(compositor_thread.Pass()))
+ return NULL;
+ return view.release();
+}
+
+WebKit::WebLayerTreeView* CreateLayerTreeView(
+ LayerTreeViewType type,
+ DRTLayerTreeViewClient* client,
+ WebKit::WebThread* thread) {
+ scoped_ptr<cc::Thread> compositor_thread;
+ if (thread)
+ compositor_thread = cc::ThreadImpl::createForDifferentThread(
+ static_cast<webkit_glue::WebThreadImpl*>(thread)->
+ message_loop()->message_loop_proxy());
+ return CreateLayerTreeView(type, client, compositor_thread.Pass());
+}
+
+// DEPRECATED. TODO(jamesr): Remove these three after fixing WebKit callers.
+static WebKit::WebLayerTreeView* CreateLayerTreeView(
+ LayerTreeViewType type,
+ DRTLayerTreeViewClient* client) {
scoped_ptr<cc::Thread> compositor_thread;
webkit::WebCompositorSupportImpl* compositor_support_impl =
@@ -536,22 +559,15 @@ static WebKit::WebLayerTreeView* CreateLayerTreeView(
if (compositor_support_impl->compositor_thread_message_loop_proxy())
compositor_thread = cc::ThreadImpl::createForDifferentThread(
compositor_support_impl->compositor_thread_message_loop_proxy());
-
- if (!view->initialize(compositor_thread.Pass()))
- return NULL;
- return view.release();
+ return CreateLayerTreeView(type, client, compositor_thread.Pass());
}
-
WebKit::WebLayerTreeView* CreateLayerTreeViewSoftware(
DRTLayerTreeViewClient* client) {
- return CreateLayerTreeView(
- WebKit::WebLayerTreeViewImplForTesting::SOFTWARE_CONTEXT, client);
+ return CreateLayerTreeView(SOFTWARE_CONTEXT, client);
}
-
WebKit::WebLayerTreeView* CreateLayerTreeView3d(
DRTLayerTreeViewClient* client) {
- return CreateLayerTreeView(
- WebKit::WebLayerTreeViewImplForTesting::MESA_CONTEXT, client);
+ return CreateLayerTreeView(MESA_CONTEXT, client);
}
void RegisterMockedURL(const WebKit::WebURL& url,
« no previous file with comments | « webkit/support/webkit_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698