| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "cc/input/layer_scroll_offset_delegate.h" | 11 #include "cc/input/layer_scroll_offset_delegate.h" |
| 12 #include "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" | 12 #include "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" |
| 13 #include "content/port/common/input_event_ack_state.h" | 13 #include "content/port/common/input_event_ack_state.h" |
| 14 #include "content/public/browser/android/synchronous_compositor.h" | 14 #include "content/public/browser/android/synchronous_compositor.h" |
| 15 #include "content/public/browser/web_contents_user_data.h" | 15 #include "content/public/browser/web_contents_user_data.h" |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 class InputHandler; | 18 class InputHandler; |
| 19 struct DidOverscrollParams; | |
| 20 } | 19 } |
| 21 | 20 |
| 22 namespace blink { | 21 namespace blink { |
| 23 class WebInputEvent; | 22 class WebInputEvent; |
| 24 } | 23 } |
| 25 | 24 |
| 26 namespace content { | 25 namespace content { |
| 27 class InputHandlerManager; | 26 class InputHandlerManager; |
| 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 cc::LayerScrollOffsetDelegate, | 35 : public cc::LayerScrollOffsetDelegate, |
| 36 public SynchronousCompositor, | 36 public SynchronousCompositor, |
| 37 public SynchronousCompositorOutputSurfaceDelegate, | 37 public SynchronousCompositorOutputSurfaceDelegate, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 virtual void SetTotalScrollOffset(const gfx::Vector2dF& new_value) OVERRIDE; | 78 virtual void SetTotalScrollOffset(const gfx::Vector2dF& new_value) OVERRIDE; |
| 79 virtual gfx::Vector2dF GetTotalScrollOffset() OVERRIDE; | 79 virtual gfx::Vector2dF GetTotalScrollOffset() OVERRIDE; |
| 80 virtual bool IsExternalFlingActive() const OVERRIDE; | 80 virtual bool IsExternalFlingActive() const OVERRIDE; |
| 81 virtual void SetTotalPageScaleFactorAndLimits( | 81 virtual void SetTotalPageScaleFactorAndLimits( |
| 82 float page_scale_factor, | 82 float page_scale_factor, |
| 83 float min_page_scale_factor, | 83 float min_page_scale_factor, |
| 84 float max_page_scale_factor) OVERRIDE; | 84 float max_page_scale_factor) OVERRIDE; |
| 85 virtual void SetScrollableSize(const gfx::SizeF& scrollable_size) OVERRIDE; | 85 virtual void SetScrollableSize(const gfx::SizeF& scrollable_size) OVERRIDE; |
| 86 | 86 |
| 87 void SetInputHandler(cc::InputHandler* input_handler); | 87 void SetInputHandler(cc::InputHandler* input_handler); |
| 88 void DidOverscroll(const cc::DidOverscrollParams& params); | 88 void DidOverscroll(const DidOverscrollParams& params); |
| 89 void DidStopFlinging(); | 89 void DidStopFlinging(); |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 explicit SynchronousCompositorImpl(WebContents* contents); | 92 explicit SynchronousCompositorImpl(WebContents* contents); |
| 93 virtual ~SynchronousCompositorImpl(); | 93 virtual ~SynchronousCompositorImpl(); |
| 94 friend class WebContentsUserData<SynchronousCompositorImpl>; | 94 friend class WebContentsUserData<SynchronousCompositorImpl>; |
| 95 | 95 |
| 96 void DidCreateSynchronousOutputSurface( | 96 void DidCreateSynchronousOutputSurface( |
| 97 SynchronousCompositorOutputSurface* output_surface); | 97 SynchronousCompositorOutputSurface* output_surface); |
| 98 bool CalledOnValidThread() const; | 98 bool CalledOnValidThread() const; |
| 99 | 99 |
| 100 SynchronousCompositorClient* compositor_client_; | 100 SynchronousCompositorClient* compositor_client_; |
| 101 SynchronousCompositorOutputSurface* output_surface_; | 101 SynchronousCompositorOutputSurface* output_surface_; |
| 102 WebContents* contents_; | 102 WebContents* contents_; |
| 103 cc::InputHandler* input_handler_; | 103 cc::InputHandler* input_handler_; |
| 104 | 104 |
| 105 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); | 105 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 } // namespace content | 108 } // namespace content |
| 109 | 109 |
| 110 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 110 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
| OLD | NEW |