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

Side by Side Diff: components/html_viewer/web_layer_tree_view_impl.cc

Issue 1298143003: Revert of Re-land: cc: Use worker context for one-copy tile initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/html_viewer/web_layer_tree_view_impl.h" 5 #include "components/html_viewer/web_layer_tree_view_impl.h"
6 6
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "cc/blink/web_layer_impl.h" 8 #include "cc/blink/web_layer_impl.h"
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/output/begin_frame_args.h" 10 #include "cc/output/begin_frame_args.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 params.settings = &settings; 56 params.settings = &settings;
57 params.task_graph_runner = task_graph_runner; 57 params.task_graph_runner = task_graph_runner;
58 params.main_task_runner = main_thread_compositor_task_runner_; 58 params.main_task_runner = main_thread_compositor_task_runner_;
59 59
60 layer_tree_host_ = 60 layer_tree_host_ =
61 cc::LayerTreeHost::CreateThreaded(compositor_task_runner, &params); 61 cc::LayerTreeHost::CreateThreaded(compositor_task_runner, &params);
62 DCHECK(layer_tree_host_); 62 DCHECK(layer_tree_host_);
63 63
64 if (surface && gpu_service) { 64 if (surface && gpu_service) {
65 mojo::CommandBufferPtr cb; 65 mojo::CommandBufferPtr cb;
66 mojo::CommandBufferPtr worker_cb;
67 gpu_service->CreateOffscreenGLES2Context(GetProxy(&cb)); 66 gpu_service->CreateOffscreenGLES2Context(GetProxy(&cb));
68 gpu_service->CreateOffscreenGLES2Context(GetProxy(&worker_cb));
69 scoped_refptr<cc::ContextProvider> context_provider( 67 scoped_refptr<cc::ContextProvider> context_provider(
70 new mojo::ContextProviderMojo(cb.PassInterface().PassHandle())); 68 new mojo::ContextProviderMojo(cb.PassInterface().PassHandle()));
71 scoped_refptr<cc::ContextProvider> worker_context_provider( 69 output_surface_.reset(
72 new mojo::ContextProviderMojo(worker_cb.PassInterface().PassHandle())); 70 new mojo::OutputSurfaceMojo(this, context_provider,
73 output_surface_.reset(new mojo::OutputSurfaceMojo( 71 surface.PassInterface().PassHandle()));
74 this, context_provider, worker_context_provider,
75 surface.PassInterface().PassHandle()));
76 } 72 }
77 layer_tree_host_->SetLayerTreeHostClientReady(); 73 layer_tree_host_->SetLayerTreeHostClientReady();
78 } 74 }
79 75
80 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() { 76 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() {
81 // Destroy the LayerTreeHost before anything else as doing so ensures we're 77 // Destroy the LayerTreeHost before anything else as doing so ensures we're
82 // not accessed on the compositor thread (we are the LayerTreeHostClient). 78 // not accessed on the compositor thread (we are the LayerTreeHostClient).
83 layer_tree_host_.reset(); 79 layer_tree_host_.reset();
84 } 80 }
85 81
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 base::Bind(&WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread, 249 base::Bind(&WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread,
254 main_thread_bound_weak_ptr_, 250 main_thread_bound_weak_ptr_,
255 id)); 251 id));
256 } 252 }
257 253
258 void WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread(cc::SurfaceId id) { 254 void WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread(cc::SurfaceId id) {
259 view_->SetSurfaceId(mojo::SurfaceId::From(id)); 255 view_->SetSurfaceId(mojo::SurfaceId::From(id));
260 } 256 }
261 257
262 } // namespace html_viewer 258 } // namespace html_viewer
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_settings.cc ('k') | content/browser/compositor/browser_compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698