| 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 "cc/blink/context_provider_web_context.h" | 9 #include "cc/blink/context_provider_web_context.h" |
| 10 #include "content/browser/android/in_process/synchronous_input_event_filter.h" | 10 #include "content/browser/android/in_process/synchronous_input_event_filter.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 scoped_refptr<base::SingleThreadTaskRunner> GetCompositorTaskRunner() | 37 scoped_refptr<base::SingleThreadTaskRunner> GetCompositorTaskRunner() |
| 38 override; | 38 override; |
| 39 bool RecordFullLayer() override; | 39 bool RecordFullLayer() override; |
| 40 scoped_ptr<cc::OutputSurface> CreateOutputSurface( | 40 scoped_ptr<cc::OutputSurface> CreateOutputSurface( |
| 41 int routing_id, | 41 int routing_id, |
| 42 scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) | 42 scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) |
| 43 override; | 43 override; |
| 44 InputHandlerManagerClient* GetInputHandlerManagerClient() override; | 44 InputHandlerManagerClient* GetInputHandlerManagerClient() override; |
| 45 scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( | 45 scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( |
| 46 int routing_id) override; | 46 int routing_id) override; |
| 47 scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory( |
| 48 int view_id) override; |
| 49 bool OverrideWithFactory() override; |
| 47 scoped_refptr<cc_blink::ContextProviderWebContext> | 50 scoped_refptr<cc_blink::ContextProviderWebContext> |
| 48 CreateOffscreenContextProvider( | 51 CreateOffscreenContextProvider( |
| 49 const blink::WebGraphicsContext3D::Attributes& attributes, | 52 const blink::WebGraphicsContext3D::Attributes& attributes, |
| 50 const std::string& debug_name) override; | 53 const std::string& debug_name) override; |
| 51 scoped_refptr<StreamTextureFactory> CreateStreamTextureFactory( | |
| 52 int view_id) override; | |
| 53 gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl* | 54 gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl* |
| 54 CreateOffscreenGraphicsContext3D( | 55 CreateOffscreenGraphicsContext3D( |
| 55 const blink::WebGraphicsContext3D::Attributes& attributes) override; | 56 const blink::WebGraphicsContext3D::Attributes& attributes) override; |
| 56 gpu::GPUInfo GetGPUInfo() const override; | 57 gpu::GPUInfo GetGPUInfo() const override; |
| 57 | 58 |
| 58 SynchronousInputEventFilter* synchronous_input_event_filter() { | 59 SynchronousInputEventFilter* synchronous_input_event_filter() { |
| 59 return &synchronous_input_event_filter_; | 60 return &synchronous_input_event_filter_; |
| 60 } | 61 } |
| 61 | 62 |
| 62 void SetDeferredGpuService( | 63 void SetDeferredGpuService( |
| 63 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); | 64 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); |
| 64 base::Thread* CreateInProcessGpuThread( | 65 base::Thread* CreateInProcessGpuThread( |
| 65 const InProcessChildThreadParams& params); | 66 const InProcessChildThreadParams& params); |
| 66 void SetRecordFullDocument(bool record_full_document); | 67 void SetRecordFullDocument(bool record_full_document); |
| 68 void SetUseIpcCommandBuffer(); |
| 67 void CompositorInitializedHardwareDraw(); | 69 void CompositorInitializedHardwareDraw(); |
| 68 void CompositorReleasedHardwareDraw(); | 70 void CompositorReleasedHardwareDraw(); |
| 69 | 71 |
| 70 scoped_refptr<cc::ContextProvider> CreateContextProviderForCompositor(); | 72 scoped_refptr<cc::ContextProvider> CreateContextProviderForCompositor(); |
| 71 | 73 |
| 72 private: | 74 private: |
| 73 bool CanCreateMainThreadContext(); | 75 bool CanCreateMainThreadContext(); |
| 74 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> | 76 scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> |
| 75 TryCreateStreamTextureFactory(); | 77 TryCreateStreamTextureFactory(); |
| 76 void RestoreContextOnMainThread(); | 78 void RestoreContextOnMainThread(); |
| 77 scoped_refptr<gpu::InProcessCommandBuffer::Service> GpuThreadService(); | 79 scoped_refptr<gpu::InProcessCommandBuffer::Service> GpuThreadService(); |
| 78 | 80 |
| 79 SynchronousInputEventFilter synchronous_input_event_filter_; | 81 SynchronousInputEventFilter synchronous_input_event_filter_; |
| 80 | 82 |
| 81 scoped_refptr<gpu::InProcessCommandBuffer::Service> android_view_service_; | 83 scoped_refptr<gpu::InProcessCommandBuffer::Service> android_view_service_; |
| 82 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_thread_service_; | 84 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_thread_service_; |
| 83 | 85 |
| 84 class VideoContextProvider; | 86 class VideoContextProvider; |
| 85 scoped_refptr<VideoContextProvider> video_context_provider_; | 87 scoped_refptr<VideoContextProvider> video_context_provider_; |
| 86 | 88 |
| 87 bool record_full_layer_; | 89 bool record_full_layer_; |
| 90 bool use_ipc_command_buffer_; |
| 88 | 91 |
| 89 // |num_hardware_compositor_lock_| is updated on UI thread only but can be | 92 // |num_hardware_compositor_lock_| is updated on UI thread only but can be |
| 90 // read on renderer main thread. | 93 // read on renderer main thread. |
| 91 base::Lock num_hardware_compositor_lock_; | 94 base::Lock num_hardware_compositor_lock_; |
| 92 unsigned int num_hardware_compositors_; | 95 unsigned int num_hardware_compositors_; |
| 93 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 96 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 94 }; | 97 }; |
| 95 | 98 |
| 96 } // namespace content | 99 } // namespace content |
| 97 | 100 |
| 98 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP
L_H_ | 101 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_FACTORY_IMP
L_H_ |
| OLD | NEW |