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

Unified Diff: components/html_viewer/web_layer_tree_view_impl.cc

Issue 1281663002: Mandoline: Allow submitting CompositorFrames directly to mojo::Views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 4 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 | « components/html_viewer/web_layer_tree_view_impl.h ('k') | components/pdf_viewer/pdf_viewer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/web_layer_tree_view_impl.cc
diff --git a/components/html_viewer/web_layer_tree_view_impl.cc b/components/html_viewer/web_layer_tree_view_impl.cc
index ca9e51ad496a0c2a29d89fcdf364373c189beea5..2cf3e217ad0dbdba9b526c157e56a5204f834ead 100644
--- a/components/html_viewer/web_layer_tree_view_impl.cc
+++ b/components/html_viewer/web_layer_tree_view_impl.cc
@@ -22,9 +22,7 @@ namespace html_viewer {
WebLayerTreeViewImpl::WebLayerTreeViewImpl(
scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
- cc::TaskGraphRunner* task_graph_runner,
- mojo::SurfacePtr surface,
- mojo::GpuPtr gpu_service)
+ cc::TaskGraphRunner* task_graph_runner)
: widget_(NULL),
view_(NULL),
main_thread_compositor_task_runner_(base::ThreadTaskRunnerHandle::Get()),
@@ -61,15 +59,20 @@ WebLayerTreeViewImpl::WebLayerTreeViewImpl(
layer_tree_host_ =
cc::LayerTreeHost::CreateThreaded(compositor_task_runner, &params);
DCHECK(layer_tree_host_);
+}
- if (surface && gpu_service) {
+void WebLayerTreeViewImpl::Initialize(mojo::GpuPtr gpu_service,
+ mojo::View* view,
+ blink::WebWidget* widget) {
+ view_ = view;
+ widget_ = widget;
+ if (gpu_service) {
mojo::CommandBufferPtr cb;
gpu_service->CreateOffscreenGLES2Context(GetProxy(&cb));
scoped_refptr<cc::ContextProvider> context_provider(
new mojo::ContextProviderMojo(cb.PassInterface().PassHandle()));
output_surface_.reset(
- new mojo::OutputSurfaceMojo(this, context_provider,
- surface.PassInterface().PassHandle()));
+ new mojo::OutputSurfaceMojo(context_provider, view_->RequestSurface()));
}
layer_tree_host_->SetLayerTreeHostClientReady();
}
@@ -246,16 +249,4 @@ void WebLayerTreeViewImpl::finishAllRendering() {
layer_tree_host_->FinishAllRendering();
}
-void WebLayerTreeViewImpl::DidCreateSurface(cc::SurfaceId id) {
- main_thread_compositor_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread,
- main_thread_bound_weak_ptr_,
- id));
-}
-
-void WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread(cc::SurfaceId id) {
- view_->SetSurfaceId(mojo::SurfaceId::From(id));
-}
-
} // namespace html_viewer
« no previous file with comments | « components/html_viewer/web_layer_tree_view_impl.h ('k') | components/pdf_viewer/pdf_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698