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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. |
98 scoped_refptr<cc::ContextProvider> offscreen_context = | 98 scoped_refptr<cc::ContextProvider> offscreen_context = |
99 g_factory.Get().GetOffscreenContextProviderForCompositorThread(); | 99 g_factory.Get().GetOffscreenContextProviderForCompositorThread(); |
100 scoped_refptr<cc::ContextProvider> onscreen_context = | 100 scoped_refptr<cc::ContextProvider> onscreen_context = |
101 g_factory.Get().CreateOnscreenContextProviderForCompositorThread(surface); | 101 g_factory.Get().CreateOnscreenContextProviderForCompositorThread(surface); |
102 | 102 |
103 bool success = | 103 bool success = output_surface_->InitializeHwDraw(onscreen_context); |
104 output_surface_->InitializeHwDraw(onscreen_context, offscreen_context); | |
105 | 104 |
106 if (success) | 105 if (success) |
107 g_factory.Get().CompositorInitializedHardwareDraw(); | 106 g_factory.Get().CompositorInitializedHardwareDraw(); |
108 return success; | 107 return success; |
109 } | 108 } |
110 | 109 |
111 void SynchronousCompositorImpl::ReleaseHwDraw() { | 110 void SynchronousCompositorImpl::ReleaseHwDraw() { |
112 DCHECK(CalledOnValidThread()); | 111 DCHECK(CalledOnValidThread()); |
113 DCHECK(output_surface_); | 112 DCHECK(output_surface_); |
114 output_surface_->ReleaseHwDraw(); | 113 output_surface_->ReleaseHwDraw(); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 g_factory.Get(); // Ensure it's initialized. | 284 g_factory.Get(); // Ensure it's initialized. |
286 SynchronousCompositorImpl::CreateForWebContents(contents); | 285 SynchronousCompositorImpl::CreateForWebContents(contents); |
287 } | 286 } |
288 if (SynchronousCompositorImpl* instance = | 287 if (SynchronousCompositorImpl* instance = |
289 SynchronousCompositorImpl::FromWebContents(contents)) { | 288 SynchronousCompositorImpl::FromWebContents(contents)) { |
290 instance->SetClient(client); | 289 instance->SetClient(client); |
291 } | 290 } |
292 } | 291 } |
293 | 292 |
294 } // namespace content | 293 } // namespace content |
OLD | NEW |