OLD | NEW |
---|---|
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 "content/browser/android/in_process/synchronous_compositor_factory_impl .h" | 10 #include "content/browser/android/in_process/synchronous_compositor_factory_impl .h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) { | 87 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) { |
88 g_factory.Get().SetDeferredGpuService(service); | 88 g_factory.Get().SetDeferredGpuService(service); |
89 } | 89 } |
90 | 90 |
91 bool SynchronousCompositorImpl::InitializeHwDraw( | 91 bool SynchronousCompositorImpl::InitializeHwDraw( |
92 scoped_refptr<gfx::GLSurface> surface) { | 92 scoped_refptr<gfx::GLSurface> surface) { |
93 DCHECK(CalledOnValidThread()); | 93 DCHECK(CalledOnValidThread()); |
94 DCHECK(output_surface_); | 94 DCHECK(output_surface_); |
95 | 95 |
96 // Create contexts in this order so that the share group gets passed | 96 // Create contexts in this order so that the share group gets passed |
97 // along correctly. | 97 // along correctly. |
no sievers
2014/05/08 18:57:14
If you are removing this, then the comment does no
| |
98 scoped_refptr<cc::ContextProvider> offscreen_context = | |
99 g_factory.Get().GetOffscreenContextProviderForCompositorThread(); | |
100 scoped_refptr<cc::ContextProvider> onscreen_context = | 98 scoped_refptr<cc::ContextProvider> onscreen_context = |
101 g_factory.Get().CreateOnscreenContextProviderForCompositorThread(surface); | 99 g_factory.Get().CreateOnscreenContextProviderForCompositorThread( |
100 surface.get()); | |
102 | 101 |
103 bool success = output_surface_->InitializeHwDraw(onscreen_context); | 102 bool success = output_surface_->InitializeHwDraw(onscreen_context); |
104 | 103 |
105 if (success) | 104 if (success) |
106 g_factory.Get().CompositorInitializedHardwareDraw(); | 105 g_factory.Get().CompositorInitializedHardwareDraw(); |
107 return success; | 106 return success; |
108 } | 107 } |
109 | 108 |
110 void SynchronousCompositorImpl::ReleaseHwDraw() { | 109 void SynchronousCompositorImpl::ReleaseHwDraw() { |
111 DCHECK(CalledOnValidThread()); | 110 DCHECK(CalledOnValidThread()); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 g_factory.Get(); // Ensure it's initialized. | 283 g_factory.Get(); // Ensure it's initialized. |
285 SynchronousCompositorImpl::CreateForWebContents(contents); | 284 SynchronousCompositorImpl::CreateForWebContents(contents); |
286 } | 285 } |
287 if (SynchronousCompositorImpl* instance = | 286 if (SynchronousCompositorImpl* instance = |
288 SynchronousCompositorImpl::FromWebContents(contents)) { | 287 SynchronousCompositorImpl::FromWebContents(contents)) { |
289 instance->SetClient(client); | 288 instance->SetClient(client); |
290 } | 289 } |
291 } | 290 } |
292 | 291 |
293 } // namespace content | 292 } // namespace content |
OLD | NEW |