| 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 28 matching lines...) Expand all Loading... |
| 39 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(int routing_id) | 39 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(int routing_id) |
| 40 OVERRIDE; | 40 OVERRIDE; |
| 41 virtual InputHandlerManagerClient* GetInputHandlerManagerClient() OVERRIDE; | 41 virtual InputHandlerManagerClient* GetInputHandlerManagerClient() OVERRIDE; |
| 42 virtual scoped_refptr<webkit::gpu::ContextProviderWebContext> | 42 virtual scoped_refptr<webkit::gpu::ContextProviderWebContext> |
| 43 GetSharedOffscreenContextProviderForMainThread() OVERRIDE; | 43 GetSharedOffscreenContextProviderForMainThread() OVERRIDE; |
| 44 virtual scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory( | 44 virtual scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory( |
| 45 int view_id) OVERRIDE; | 45 int view_id) OVERRIDE; |
| 46 virtual blink::WebGraphicsContext3D* CreateOffscreenGraphicsContext3D( | 46 virtual blink::WebGraphicsContext3D* CreateOffscreenGraphicsContext3D( |
| 47 const blink::WebGraphicsContext3D::Attributes& attributes) OVERRIDE; | 47 const blink::WebGraphicsContext3D::Attributes& attributes) OVERRIDE; |
| 48 | 48 |
| 49 // This is called on the renderer compositor impl thread (InitializeHwDraw) in | |
| 50 // order to support Android WebView synchronously enable and disable hardware | |
| 51 // mode multiple times in the same task. | |
| 52 scoped_refptr<cc::ContextProvider> | |
| 53 GetOffscreenContextProviderForCompositorThread(); | |
| 54 | 49 |
| 55 SynchronousInputEventFilter* synchronous_input_event_filter() { | 50 SynchronousInputEventFilter* synchronous_input_event_filter() { |
| 56 return &synchronous_input_event_filter_; | 51 return &synchronous_input_event_filter_; |
| 57 } | 52 } |
| 58 | 53 |
| 59 void SetDeferredGpuService( | 54 void SetDeferredGpuService( |
| 60 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); | 55 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); |
| 61 void CompositorInitializedHardwareDraw(); | 56 void CompositorInitializedHardwareDraw(); |
| 62 void CompositorReleasedHardwareDraw(); | 57 void CompositorReleasedHardwareDraw(); |
| 63 | 58 |
| 64 scoped_refptr<cc::ContextProvider> | 59 scoped_refptr<cc::ContextProvider> |
| 65 CreateOnscreenContextProviderForCompositorThread( | 60 CreateOnscreenContextProviderForCompositorThread( |
| 66 scoped_refptr<gfx::GLSurface> surface); | 61 gfx::GLSurface* surface); |
| 67 | 62 |
| 68 private: | 63 private: |
| 69 bool CanCreateMainThreadContext(); | 64 bool CanCreateMainThreadContext(); |
| 70 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> | 65 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> |
| 71 TryCreateStreamTextureFactory(); | 66 TryCreateStreamTextureFactory(); |
| 67 void EnsureShareContextCreated(); |
| 72 | 68 |
| 73 SynchronousInputEventFilter synchronous_input_event_filter_; | 69 SynchronousInputEventFilter synchronous_input_event_filter_; |
| 74 | 70 |
| 75 scoped_refptr<webkit::gpu::ContextProviderWebContext> | 71 scoped_refptr<webkit::gpu::ContextProviderWebContext> |
| 76 offscreen_context_for_main_thread_; | 72 offscreen_context_for_main_thread_; |
| 77 // This is a pointer to the context owned by | |
| 78 // |offscreen_context_for_main_thread_|. | |
| 79 gpu::GLInProcessContext* wrapped_gl_context_for_compositor_thread_; | |
| 80 scoped_refptr<cc::ContextProvider> offscreen_context_for_compositor_thread_; | |
| 81 | 73 |
| 82 scoped_refptr<gpu::InProcessCommandBuffer::Service> service_; | 74 scoped_refptr<gpu::InProcessCommandBuffer::Service> service_; |
| 75 scoped_ptr<gpu::GLInProcessContext> share_context_; |
| 83 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> | 76 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> |
| 84 video_context_provider_; | 77 video_context_provider_; |
| 85 | 78 |
| 86 // |num_hardware_compositor_lock_| is updated on UI thread only but can be | 79 // |num_hardware_compositor_lock_| is updated on UI thread only but can be |
| 87 // read on renderer main thread. | 80 // read on renderer main thread. |
| 88 base::Lock num_hardware_compositor_lock_; | 81 base::Lock num_hardware_compositor_lock_; |
| 89 unsigned int num_hardware_compositors_; | 82 unsigned int num_hardware_compositors_; |
| 90 }; | 83 }; |
| 91 | 84 |
| 92 } // namespace content | 85 } // namespace content |
| 93 | 86 |
| 94 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP
L_H_ | 87 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP
L_H_ |
| OLD | NEW |