| 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 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "content/browser/android/synchronous_compositor_base.h" | 13 #include "content/browser/android/synchronous_compositor_base.h" |
| 14 #include "content/renderer/android/synchronous_compositor_external_begin_frame_s
ource.h" | 14 #include "content/renderer/android/synchronous_compositor_external_begin_frame_s
ource.h" |
| 15 #include "content/renderer/android/synchronous_compositor_output_surface.h" | 15 #include "content/renderer/android/synchronous_compositor_output_surface.h" |
| 16 #include "content/renderer/input/synchronous_input_handler_proxy.h" | |
| 17 #include "ipc/ipc_message.h" | 16 #include "ipc/ipc_message.h" |
| 17 #include "ui/events/blink/synchronous_input_handler_proxy.h" |
| 18 | 18 |
| 19 namespace cc { | 19 namespace cc { |
| 20 class InputHandler; | 20 class InputHandler; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 class InputHandlerManager; | 24 class InputHandlerManager; |
| 25 class RenderWidgetHostViewAndroid; | 25 class RenderWidgetHostViewAndroid; |
| 26 class SynchronousCompositorExternalBeginFrameSource; | 26 class SynchronousCompositorExternalBeginFrameSource; |
| 27 struct DidOverscrollParams; | 27 struct DidOverscrollParams; |
| 28 | 28 |
| 29 // The purpose of this class is to act as the intermediary between the various | 29 // The purpose of this class is to act as the intermediary between the various |
| 30 // components that make up the 'synchronous compositor mode' implementation and | 30 // components that make up the 'synchronous compositor mode' implementation and |
| 31 // expose their functionality via the SynchronousCompositor interface. | 31 // expose their functionality via the SynchronousCompositor interface. |
| 32 // This class is created on the main thread but most of the APIs are called | 32 // This class is created on the main thread but most of the APIs are called |
| 33 // from the Compositor thread. | 33 // from the Compositor thread. |
| 34 class SynchronousCompositorImpl | 34 class SynchronousCompositorImpl |
| 35 : public SynchronousInputHandler, | 35 : public ui::SynchronousInputHandler, |
| 36 public SynchronousCompositorBase, | 36 public SynchronousCompositorBase, |
| 37 public SynchronousCompositorExternalBeginFrameSourceClient, | 37 public SynchronousCompositorExternalBeginFrameSourceClient, |
| 38 public SynchronousCompositorOutputSurfaceClient { | 38 public SynchronousCompositorOutputSurfaceClient { |
| 39 public: | 39 public: |
| 40 // For handling upcalls from renderer code; the process id | 40 // For handling upcalls from renderer code; the process id |
| 41 // is implicitly that of the in-process renderer. | 41 // is implicitly that of the in-process renderer. |
| 42 static SynchronousCompositorImpl* FromRoutingID(int routing_id); | 42 static SynchronousCompositorImpl* FromRoutingID(int routing_id); |
| 43 | 43 |
| 44 static void SetGpuServiceInProc( | 44 static void SetGpuServiceInProc( |
| 45 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); | 45 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); |
| 46 | 46 |
| 47 ~SynchronousCompositorImpl() override; | 47 ~SynchronousCompositorImpl() override; |
| 48 | 48 |
| 49 // Called by SynchronousCompositorRegistry. | 49 // Called by SynchronousCompositorRegistry. |
| 50 void DidInitializeRendererObjects( | 50 void DidInitializeRendererObjects( |
| 51 SynchronousCompositorOutputSurface* output_surface, | 51 SynchronousCompositorOutputSurface* output_surface, |
| 52 SynchronousCompositorExternalBeginFrameSource* begin_frame_source, | 52 SynchronousCompositorExternalBeginFrameSource* begin_frame_source, |
| 53 SynchronousInputHandlerProxy* synchronous_input_handler_proxy); | 53 ui::SynchronousInputHandlerProxy* synchronous_input_handler_proxy); |
| 54 void DidDestroyRendererObjects(); | 54 void DidDestroyRendererObjects(); |
| 55 | 55 |
| 56 // SynchronousCompositorExternalBeginFrameSourceClient overrides. | 56 // SynchronousCompositorExternalBeginFrameSourceClient overrides. |
| 57 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; | 57 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; |
| 58 | 58 |
| 59 // SynchronousCompositorOutputSurfaceClient overrides. | 59 // SynchronousCompositorOutputSurfaceClient overrides. |
| 60 void Invalidate() override; | 60 void Invalidate() override; |
| 61 | 61 |
| 62 // SynchronousCompositor overrides. | 62 // SynchronousCompositor overrides. |
| 63 scoped_ptr<cc::CompositorFrame> DemandDrawHw( | 63 scoped_ptr<cc::CompositorFrame> DemandDrawHw( |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 void DidActivatePendingTree(); | 102 void DidActivatePendingTree(); |
| 103 void DeliverMessages(); | 103 void DeliverMessages(); |
| 104 bool CalledOnValidThread() const; | 104 bool CalledOnValidThread() const; |
| 105 void UpdateNeedsBeginFrames(); | 105 void UpdateNeedsBeginFrames(); |
| 106 | 106 |
| 107 RenderWidgetHostViewAndroid* const rwhva_; | 107 RenderWidgetHostViewAndroid* const rwhva_; |
| 108 const int routing_id_; | 108 const int routing_id_; |
| 109 SynchronousCompositorClient* const compositor_client_; | 109 SynchronousCompositorClient* const compositor_client_; |
| 110 SynchronousCompositorOutputSurface* output_surface_; | 110 SynchronousCompositorOutputSurface* output_surface_; |
| 111 SynchronousCompositorExternalBeginFrameSource* begin_frame_source_; | 111 SynchronousCompositorExternalBeginFrameSource* begin_frame_source_; |
| 112 SynchronousInputHandlerProxy* synchronous_input_handler_proxy_; | 112 ui::SynchronousInputHandlerProxy* synchronous_input_handler_proxy_; |
| 113 bool registered_with_client_; | 113 bool registered_with_client_; |
| 114 bool is_active_; | 114 bool is_active_; |
| 115 bool renderer_needs_begin_frames_; | 115 bool renderer_needs_begin_frames_; |
| 116 bool need_animate_input_; | 116 bool need_animate_input_; |
| 117 | 117 |
| 118 base::WeakPtrFactory<SynchronousCompositorImpl> weak_ptr_factory_; | 118 base::WeakPtrFactory<SynchronousCompositorImpl> weak_ptr_factory_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); | 120 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace content | 123 } // namespace content |
| 124 | 124 |
| 125 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 125 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
| OLD | NEW |