| 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" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // When used from browser code, use both |process_id| and |routing_id|. | 43 // When used from browser code, use both |process_id| and |routing_id|. |
| 44 static SynchronousCompositorImpl* FromID(int process_id, int routing_id); | 44 static SynchronousCompositorImpl* FromID(int process_id, int routing_id); |
| 45 // When handling upcalls from renderer code, use this version; the process id | 45 // When handling upcalls from renderer code, use this version; the process id |
| 46 // is implicitly that of the in-process renderer. | 46 // is implicitly that of the in-process renderer. |
| 47 static SynchronousCompositorImpl* FromRoutingID(int routing_id); | 47 static SynchronousCompositorImpl* FromRoutingID(int routing_id); |
| 48 | 48 |
| 49 InputEventAckState HandleInputEvent(const blink::WebInputEvent& input_event); | 49 InputEventAckState HandleInputEvent(const blink::WebInputEvent& input_event); |
| 50 | 50 |
| 51 // SynchronousCompositor | 51 // SynchronousCompositor |
| 52 virtual void SetClient(SynchronousCompositorClient* compositor_client) | 52 virtual void SetClient(SynchronousCompositorClient* compositor_client) |
| 53 OVERRIDE; | 53 override; |
| 54 virtual bool InitializeHwDraw() OVERRIDE; | 54 virtual bool InitializeHwDraw() override; |
| 55 virtual void ReleaseHwDraw() OVERRIDE; | 55 virtual void ReleaseHwDraw() override; |
| 56 virtual scoped_ptr<cc::CompositorFrame> DemandDrawHw( | 56 virtual scoped_ptr<cc::CompositorFrame> DemandDrawHw( |
| 57 gfx::Size surface_size, | 57 gfx::Size surface_size, |
| 58 const gfx::Transform& transform, | 58 const gfx::Transform& transform, |
| 59 gfx::Rect viewport, | 59 gfx::Rect viewport, |
| 60 gfx::Rect clip, | 60 gfx::Rect clip, |
| 61 gfx::Rect viewport_rect_for_tile_priority, | 61 gfx::Rect viewport_rect_for_tile_priority, |
| 62 const gfx::Transform& transform_for_tile_priority) OVERRIDE; | 62 const gfx::Transform& transform_for_tile_priority) override; |
| 63 virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE; | 63 virtual bool DemandDrawSw(SkCanvas* canvas) override; |
| 64 virtual void ReturnResources( | 64 virtual void ReturnResources( |
| 65 const cc::CompositorFrameAck& frame_ack) OVERRIDE; | 65 const cc::CompositorFrameAck& frame_ack) override; |
| 66 virtual void SetMemoryPolicy( | 66 virtual void SetMemoryPolicy( |
| 67 const SynchronousCompositorMemoryPolicy& policy) OVERRIDE; | 67 const SynchronousCompositorMemoryPolicy& policy) override; |
| 68 virtual void DidChangeRootLayerScrollOffset() OVERRIDE; | 68 virtual void DidChangeRootLayerScrollOffset() override; |
| 69 | 69 |
| 70 // SynchronousCompositorOutputSurfaceDelegate | 70 // SynchronousCompositorOutputSurfaceDelegate |
| 71 virtual void DidBindOutputSurface( | 71 virtual void DidBindOutputSurface( |
| 72 SynchronousCompositorOutputSurface* output_surface) OVERRIDE; | 72 SynchronousCompositorOutputSurface* output_surface) override; |
| 73 virtual void DidDestroySynchronousOutputSurface( | 73 virtual void DidDestroySynchronousOutputSurface( |
| 74 SynchronousCompositorOutputSurface* output_surface) OVERRIDE; | 74 SynchronousCompositorOutputSurface* output_surface) override; |
| 75 virtual void SetContinuousInvalidate(bool enable) OVERRIDE; | 75 virtual void SetContinuousInvalidate(bool enable) override; |
| 76 virtual void DidActivatePendingTree() OVERRIDE; | 76 virtual void DidActivatePendingTree() override; |
| 77 | 77 |
| 78 // LayerScrollOffsetDelegate | 78 // LayerScrollOffsetDelegate |
| 79 virtual gfx::ScrollOffset GetTotalScrollOffset() OVERRIDE; | 79 virtual gfx::ScrollOffset GetTotalScrollOffset() override; |
| 80 virtual void UpdateRootLayerState( | 80 virtual void UpdateRootLayerState( |
| 81 const gfx::ScrollOffset& total_scroll_offset, | 81 const gfx::ScrollOffset& total_scroll_offset, |
| 82 const gfx::ScrollOffset& max_scroll_offset, | 82 const gfx::ScrollOffset& max_scroll_offset, |
| 83 const gfx::SizeF& scrollable_size, | 83 const gfx::SizeF& scrollable_size, |
| 84 float page_scale_factor, | 84 float page_scale_factor, |
| 85 float min_page_scale_factor, | 85 float min_page_scale_factor, |
| 86 float max_page_scale_factor) OVERRIDE; | 86 float max_page_scale_factor) override; |
| 87 virtual bool IsExternalFlingActive() const OVERRIDE; | 87 virtual bool IsExternalFlingActive() const override; |
| 88 | 88 |
| 89 void SetInputHandler(cc::InputHandler* input_handler); | 89 void SetInputHandler(cc::InputHandler* input_handler); |
| 90 void DidOverscroll(const DidOverscrollParams& params); | 90 void DidOverscroll(const DidOverscrollParams& params); |
| 91 void DidStopFlinging(); | 91 void DidStopFlinging(); |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 explicit SynchronousCompositorImpl(WebContents* contents); | 94 explicit SynchronousCompositorImpl(WebContents* contents); |
| 95 virtual ~SynchronousCompositorImpl(); | 95 virtual ~SynchronousCompositorImpl(); |
| 96 friend class WebContentsUserData<SynchronousCompositorImpl>; | 96 friend class WebContentsUserData<SynchronousCompositorImpl>; |
| 97 | 97 |
| 98 void UpdateFrameMetaData(const cc::CompositorFrameMetadata& frame_info); | 98 void UpdateFrameMetaData(const cc::CompositorFrameMetadata& frame_info); |
| 99 void DeliverMessages(); | 99 void DeliverMessages(); |
| 100 bool CalledOnValidThread() const; | 100 bool CalledOnValidThread() const; |
| 101 | 101 |
| 102 SynchronousCompositorClient* compositor_client_; | 102 SynchronousCompositorClient* compositor_client_; |
| 103 SynchronousCompositorOutputSurface* output_surface_; | 103 SynchronousCompositorOutputSurface* output_surface_; |
| 104 WebContents* contents_; | 104 WebContents* contents_; |
| 105 cc::InputHandler* input_handler_; | 105 cc::InputHandler* input_handler_; |
| 106 | 106 |
| 107 base::WeakPtrFactory<SynchronousCompositorImpl> weak_ptr_factory_; | 107 base::WeakPtrFactory<SynchronousCompositorImpl> weak_ptr_factory_; |
| 108 | 108 |
| 109 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); | 109 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 } // namespace content | 112 } // namespace content |
| 113 | 113 |
| 114 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 114 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
| OLD | NEW |