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