| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H
_ | 5 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H
_ |
| 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H
_ | 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMPL_H
_ |
| 7 | 7 |
| 8 #include "base/synchronization/lock.h" | 8 #include "base/synchronization/lock.h" |
| 9 #include "content/browser/android/in_process/synchronous_input_event_filter.h" | 9 #include "content/browser/android/in_process/synchronous_input_event_filter.h" |
| 10 #include "content/renderer/android/synchronous_compositor_factory.h" | 10 #include "content/renderer/android/synchronous_compositor_factory.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 GetOffscreenContextProviderForCompositorThread() OVERRIDE; | 46 GetOffscreenContextProviderForCompositorThread() OVERRIDE; |
| 47 virtual scoped_ptr<StreamTextureFactory> CreateStreamTextureFactory( | 47 virtual scoped_ptr<StreamTextureFactory> CreateStreamTextureFactory( |
| 48 int view_id) OVERRIDE; | 48 int view_id) OVERRIDE; |
| 49 | 49 |
| 50 SynchronousInputEventFilter* synchronous_input_event_filter() { | 50 SynchronousInputEventFilter* synchronous_input_event_filter() { |
| 51 return &synchronous_input_event_filter_; | 51 return &synchronous_input_event_filter_; |
| 52 } | 52 } |
| 53 | 53 |
| 54 void CompositorInitializedHardwareDraw(); | 54 void CompositorInitializedHardwareDraw(); |
| 55 void CompositorReleasedHardwareDraw(); | 55 void CompositorReleasedHardwareDraw(); |
| 56 gpu::GLInProcessContext* GetCompositorShareGroup() { |
| 57 return wrapped_gl_context_for_compositor_thread_; |
| 58 } |
| 56 | 59 |
| 57 private: | 60 private: |
| 58 void ReleaseGlobalHardwareResources(); | 61 void ReleaseGlobalHardwareResources(); |
| 59 bool CanCreateMainThreadContext(); | 62 bool CanCreateMainThreadContext(); |
| 60 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> | 63 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> |
| 61 TryCreateStreamTextureFactory(); | 64 TryCreateStreamTextureFactory(); |
| 62 scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> | 65 scoped_ptr<gpu::GLInProcessContext> CreateOffscreenContext(); |
| 63 CreateOffscreenContext(); | 66 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> WrapContext( |
| 67 scoped_ptr<gpu::GLInProcessContext> context); |
| 64 | 68 |
| 65 SynchronousInputEventFilter synchronous_input_event_filter_; | 69 SynchronousInputEventFilter synchronous_input_event_filter_; |
| 66 | 70 |
| 67 // Only guards construction and destruction of | 71 // Only guards construction and destruction of |
| 68 // |offscreen_context_for_compositor_thread_|, not usage. | 72 // |offscreen_context_for_compositor_thread_|, not usage. |
| 69 base::Lock offscreen_context_for_compositor_thread_lock_; | 73 base::Lock offscreen_context_for_compositor_thread_lock_; |
| 70 scoped_refptr<webkit::gpu::ContextProviderWebContext> | 74 scoped_refptr<webkit::gpu::ContextProviderWebContext> |
| 71 offscreen_context_for_main_thread_; | 75 offscreen_context_for_main_thread_; |
| 72 // This is a pointer to the context owned by | 76 // This is a pointer to the context owned by |
| 73 // |offscreen_context_for_main_thread_|. | 77 // |offscreen_context_for_main_thread_|. |
| 74 gpu::GLInProcessContext* wrapped_gl_context_for_main_thread_; | 78 gpu::GLInProcessContext* wrapped_gl_context_for_main_thread_; |
| 79 gpu::GLInProcessContext* wrapped_gl_context_for_compositor_thread_; |
| 75 scoped_refptr<cc::ContextProvider> offscreen_context_for_compositor_thread_; | 80 scoped_refptr<cc::ContextProvider> offscreen_context_for_compositor_thread_; |
| 76 | 81 |
| 77 // |num_hardware_compositor_lock_| is updated on UI thread only but can be | 82 // |num_hardware_compositor_lock_| is updated on UI thread only but can be |
| 78 // read on renderer main thread. | 83 // read on renderer main thread. |
| 79 base::Lock num_hardware_compositor_lock_; | 84 base::Lock num_hardware_compositor_lock_; |
| 80 unsigned int num_hardware_compositors_; | 85 unsigned int num_hardware_compositors_; |
| 81 }; | 86 }; |
| 82 | 87 |
| 83 } // namespace content | 88 } // namespace content |
| 84 | 89 |
| 85 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP
L_H_ | 90 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP
L_H_ |
| OLD | NEW |