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

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_impl.cc

Issue 143023005: Support multiple service instances with GLInProcessContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/android/in_process/synchronous_compositor_impl.h" 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "cc/input/input_handler.h" 9 #include "cc/input/input_handler.h"
10 #include "cc/input/layer_scroll_offset_delegate.h" 10 #include "cc/input/layer_scroll_offset_delegate.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 SetInputHandler(NULL); 76 SetInputHandler(NULL);
77 } 77 }
78 78
79 void SynchronousCompositorImpl::SetClient( 79 void SynchronousCompositorImpl::SetClient(
80 SynchronousCompositorClient* compositor_client) { 80 SynchronousCompositorClient* compositor_client) {
81 DCHECK(CalledOnValidThread()); 81 DCHECK(CalledOnValidThread());
82 compositor_client_ = compositor_client; 82 compositor_client_ = compositor_client;
83 } 83 }
84 84
85 bool SynchronousCompositorImpl::InitializeHwDraw( 85 bool SynchronousCompositorImpl::InitializeHwDraw(
86 scoped_refptr<gfx::GLSurface> surface) { 86 scoped_refptr<gfx::GLSurface> surface,
87 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) {
87 DCHECK(CalledOnValidThread()); 88 DCHECK(CalledOnValidThread());
88 DCHECK(output_surface_); 89 DCHECK(output_surface_);
89 bool success = output_surface_->InitializeHwDraw( 90 bool success = output_surface_->InitializeHwDraw(
90 surface, 91 surface,
91 g_factory.Get().GetOffscreenContextProviderForCompositorThread()); 92 service,
93 g_factory.Get().GetOffscreenContextProviderForCompositorThread(),
94 g_factory.Get().GetCompositorShareGroup());
92 if (success) 95 if (success)
93 g_factory.Get().CompositorInitializedHardwareDraw(); 96 g_factory.Get().CompositorInitializedHardwareDraw();
94 return success; 97 return success;
95 } 98 }
96 99
97 void SynchronousCompositorImpl::ReleaseHwDraw() { 100 void SynchronousCompositorImpl::ReleaseHwDraw() {
98 DCHECK(CalledOnValidThread()); 101 DCHECK(CalledOnValidThread());
99 DCHECK(output_surface_); 102 DCHECK(output_surface_);
100 output_surface_->ReleaseHwDraw(); 103 output_surface_->ReleaseHwDraw();
101 g_factory.Get().CompositorReleasedHardwareDraw(); 104 g_factory.Get().CompositorReleasedHardwareDraw();
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 g_factory.Get(); // Ensure it's initialized. 271 g_factory.Get(); // Ensure it's initialized.
269 SynchronousCompositorImpl::CreateForWebContents(contents); 272 SynchronousCompositorImpl::CreateForWebContents(contents);
270 } 273 }
271 if (SynchronousCompositorImpl* instance = 274 if (SynchronousCompositorImpl* instance =
272 SynchronousCompositorImpl::FromWebContents(contents)) { 275 SynchronousCompositorImpl::FromWebContents(contents)) {
273 instance->SetClient(client); 276 instance->SetClient(client);
274 } 277 }
275 } 278 }
276 279
277 } // namespace content 280 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698