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.h" | 8 #include "base/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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 virtual scoped_refptr<cc::ContextProvider> | 66 virtual scoped_refptr<cc::ContextProvider> |
67 GetOffscreenContextProviderForMainThread() OVERRIDE { | 67 GetOffscreenContextProviderForMainThread() OVERRIDE { |
68 NOTIMPLEMENTED() | 68 NOTIMPLEMENTED() |
69 << "Synchronous compositor does not support main thread context yet."; | 69 << "Synchronous compositor does not support main thread context yet."; |
70 return scoped_refptr<cc::ContextProvider>(); | 70 return scoped_refptr<cc::ContextProvider>(); |
71 } | 71 } |
72 | 72 |
73 virtual scoped_refptr<cc::ContextProvider> | 73 virtual scoped_refptr<cc::ContextProvider> |
74 GetOffscreenContextProviderForCompositorThread() OVERRIDE { | 74 GetOffscreenContextProviderForCompositorThread() OVERRIDE { |
75 if (!offscreen_context_for_compositor_thread_ || | 75 if (!offscreen_context_for_compositor_thread_.get() || |
76 offscreen_context_for_compositor_thread_->DestroyedOnMainThread()) { | 76 offscreen_context_for_compositor_thread_->DestroyedOnMainThread()) { |
77 offscreen_context_for_compositor_thread_ = | 77 offscreen_context_for_compositor_thread_ = |
78 webkit::gpu::ContextProviderInProcess::Create(); | 78 webkit::gpu::ContextProviderInProcess::Create(); |
79 } | 79 } |
80 return offscreen_context_for_compositor_thread_; | 80 return offscreen_context_for_compositor_thread_; |
81 } | 81 } |
82 | 82 |
83 private: | 83 private: |
84 SynchronousInputEventFilter synchronous_input_event_filter_; | 84 SynchronousInputEventFilter synchronous_input_event_filter_; |
85 scoped_refptr<cc::ContextProvider> offscreen_context_for_compositor_thread_; | 85 scoped_refptr<cc::ContextProvider> offscreen_context_for_compositor_thread_; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 g_factory.Get(); // Ensure it's initialized. | 243 g_factory.Get(); // Ensure it's initialized. |
244 SynchronousCompositorImpl::CreateForWebContents(contents); | 244 SynchronousCompositorImpl::CreateForWebContents(contents); |
245 } | 245 } |
246 if (SynchronousCompositorImpl* instance = | 246 if (SynchronousCompositorImpl* instance = |
247 SynchronousCompositorImpl::FromWebContents(contents)) { | 247 SynchronousCompositorImpl::FromWebContents(contents)) { |
248 instance->SetClient(client); | 248 instance->SetClient(client); |
249 } | 249 } |
250 } | 250 } |
251 | 251 |
252 } // namespace content | 252 } // namespace content |
OLD | NEW |