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

Unified Diff: mandoline/ui/aura/surface_binding.cc

Issue 1288653005: [Work In Progress] Use worker context provider in SurfaceBinding 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mandoline/ui/aura/surface_binding.cc
diff --git a/mandoline/ui/aura/surface_binding.cc b/mandoline/ui/aura/surface_binding.cc
index f610fed0f658132d6d35602d1ccf676d9b91d5c3..43beb2c23496892322b3e12700d897a411271fb6 100644
--- a/mandoline/ui/aura/surface_binding.cc
+++ b/mandoline/ui/aura/surface_binding.cc
@@ -34,11 +34,13 @@ namespace {
// appropriate.
class OutputSurfaceImpl : public cc::OutputSurface {
public:
- OutputSurfaceImpl(mojo::View* view,
- const scoped_refptr<cc::ContextProvider>& context_provider,
- mojo::Surface* surface,
- uint32_t id_namespace,
- uint32_t* next_local_id);
+ OutputSurfaceImpl(
+ mojo::View* view,
+ const scoped_refptr<cc::ContextProvider>& context_provider,
+ const scoped_refptr<cc::ContextProvider>& worker_context_provider,
+ mojo::Surface* surface,
+ uint32_t id_namespace,
+ uint32_t* next_local_id);
~OutputSurfaceImpl() override;
// cc::OutputSurface:
@@ -58,10 +60,11 @@ class OutputSurfaceImpl : public cc::OutputSurface {
OutputSurfaceImpl::OutputSurfaceImpl(
mojo::View* view,
const scoped_refptr<cc::ContextProvider>& context_provider,
+ const scoped_refptr<cc::ContextProvider>& worker_context_provider,
mojo::Surface* surface,
uint32_t id_namespace,
uint32_t* next_local_id)
- : cc::OutputSurface(context_provider),
+ : cc::OutputSurface(context_provider, worker_context_provider),
view_(view),
surface_(surface),
id_namespace_(id_namespace),
@@ -172,11 +175,16 @@ SurfaceBinding::PerViewManagerState::CreateOutputSurface(mojo::View* view) {
// TODO(sky): figure out lifetime here. Do I need to worry about the return
// value outliving this?
mojo::CommandBufferPtr cb;
+ mojo::CommandBufferPtr worker_cb;
gpu_->CreateOffscreenGLES2Context(GetProxy(&cb));
+ gpu_->CreateOffscreenGLES2Context(GetProxy(&worker_cb));
scoped_refptr<cc::ContextProvider> context_provider(
new mojo::ContextProviderMojo(cb.PassInterface().PassHandle()));
+ scoped_refptr<cc::ContextProvider> worker_context_provider(
+ new mojo::ContextProviderMojo(worker_cb.PassInterface().PassHandle()));
return make_scoped_ptr(new OutputSurfaceImpl(
- view, context_provider, surface_.get(), id_namespace_, &next_local_id_));
+ view, context_provider, worker_context_provider, surface_.get(),
+ id_namespace_, &next_local_id_));
}
SurfaceBinding::PerViewManagerState::PerViewManagerState(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698