| 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 gpu::GLInProcessContext* GetShareContext() OVERRIDE; |
| 55 virtual scoped_ptr<cc::CompositorFrame> DemandDrawHw( |
| 55 gfx::Size surface_size, | 56 gfx::Size surface_size, |
| 56 const gfx::Transform& transform, | 57 const gfx::Transform& transform, |
| 57 gfx::Rect viewport, | 58 gfx::Rect viewport, |
| 58 gfx::Rect clip, | 59 gfx::Rect clip, |
| 59 bool stencil_enabled) OVERRIDE; | 60 bool stencil_enabled) OVERRIDE; |
| 60 virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE; | 61 virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE; |
| 62 virtual void ReturnResources( |
| 63 const cc::CompositorFrameAck& frame_ack) OVERRIDE; |
| 61 virtual void SetMemoryPolicy( | 64 virtual void SetMemoryPolicy( |
| 62 const SynchronousCompositorMemoryPolicy& policy) OVERRIDE; | 65 const SynchronousCompositorMemoryPolicy& policy) OVERRIDE; |
| 63 virtual void DidChangeRootLayerScrollOffset() OVERRIDE; | 66 virtual void DidChangeRootLayerScrollOffset() OVERRIDE; |
| 64 | 67 |
| 65 // SynchronousCompositorOutputSurfaceDelegate | 68 // SynchronousCompositorOutputSurfaceDelegate |
| 66 virtual void DidBindOutputSurface( | 69 virtual void DidBindOutputSurface( |
| 67 SynchronousCompositorOutputSurface* output_surface) OVERRIDE; | 70 SynchronousCompositorOutputSurface* output_surface) OVERRIDE; |
| 68 virtual void DidDestroySynchronousOutputSurface( | 71 virtual void DidDestroySynchronousOutputSurface( |
| 69 SynchronousCompositorOutputSurface* output_surface) OVERRIDE; | 72 SynchronousCompositorOutputSurface* output_surface) OVERRIDE; |
| 70 virtual void SetContinuousInvalidate(bool enable) OVERRIDE; | 73 virtual void SetContinuousInvalidate(bool enable) OVERRIDE; |
| 71 virtual void UpdateFrameMetaData( | |
| 72 const cc::CompositorFrameMetadata& frame_info) OVERRIDE; | |
| 73 virtual void DidActivatePendingTree() OVERRIDE; | 74 virtual void DidActivatePendingTree() OVERRIDE; |
| 74 | 75 |
| 75 // LayerScrollOffsetDelegate | 76 // LayerScrollOffsetDelegate |
| 76 virtual gfx::Vector2dF GetTotalScrollOffset() OVERRIDE; | 77 virtual gfx::Vector2dF GetTotalScrollOffset() OVERRIDE; |
| 77 virtual void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset, | 78 virtual void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset, |
| 78 const gfx::Vector2dF& max_scroll_offset, | 79 const gfx::Vector2dF& max_scroll_offset, |
| 79 const gfx::SizeF& scrollable_size, | 80 const gfx::SizeF& scrollable_size, |
| 80 float page_scale_factor, | 81 float page_scale_factor, |
| 81 float min_page_scale_factor, | 82 float min_page_scale_factor, |
| 82 float max_page_scale_factor) OVERRIDE; | 83 float max_page_scale_factor) OVERRIDE; |
| 83 virtual bool IsExternalFlingActive() const OVERRIDE; | 84 virtual bool IsExternalFlingActive() const OVERRIDE; |
| 84 | 85 |
| 85 void SetInputHandler(cc::InputHandler* input_handler); | 86 void SetInputHandler(cc::InputHandler* input_handler); |
| 86 void DidOverscroll(const DidOverscrollParams& params); | 87 void DidOverscroll(const DidOverscrollParams& params); |
| 87 void DidStopFlinging(); | 88 void DidStopFlinging(); |
| 88 | 89 |
| 89 private: | 90 private: |
| 90 explicit SynchronousCompositorImpl(WebContents* contents); | 91 explicit SynchronousCompositorImpl(WebContents* contents); |
| 91 virtual ~SynchronousCompositorImpl(); | 92 virtual ~SynchronousCompositorImpl(); |
| 92 friend class WebContentsUserData<SynchronousCompositorImpl>; | 93 friend class WebContentsUserData<SynchronousCompositorImpl>; |
| 93 | 94 |
| 94 void DidCreateSynchronousOutputSurface( | 95 void UpdateFrameMetaData(const cc::CompositorFrameMetadata& frame_info); |
| 95 SynchronousCompositorOutputSurface* output_surface); | |
| 96 bool CalledOnValidThread() const; | 96 bool CalledOnValidThread() const; |
| 97 | 97 |
| 98 SynchronousCompositorClient* compositor_client_; | 98 SynchronousCompositorClient* compositor_client_; |
| 99 SynchronousCompositorOutputSurface* output_surface_; | 99 SynchronousCompositorOutputSurface* output_surface_; |
| 100 WebContents* contents_; | 100 WebContents* contents_; |
| 101 cc::InputHandler* input_handler_; | 101 cc::InputHandler* input_handler_; |
| 102 | 102 |
| 103 base::WeakPtrFactory<SynchronousCompositorImpl> weak_ptr_factory_; |
| 104 |
| 103 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); | 105 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); |
| 104 }; | 106 }; |
| 105 | 107 |
| 106 } // namespace content | 108 } // namespace content |
| 107 | 109 |
| 108 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 110 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
| OLD | NEW |