| 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 20 matching lines...) Expand all Loading... |
| 31 public: | 31 public: |
| 32 // When used from browser code, use both |process_id| and |routing_id|. | 32 // When used from browser code, use both |process_id| and |routing_id|. |
| 33 static SynchronousCompositorImpl* FromID(int process_id, int routing_id); | 33 static SynchronousCompositorImpl* FromID(int process_id, int routing_id); |
| 34 // When handling upcalls from renderer code, use this version; the process id | 34 // When handling upcalls from renderer code, use this version; the process id |
| 35 // is implicitly that of the in-process renderer. | 35 // is implicitly that of the in-process renderer. |
| 36 static SynchronousCompositorImpl* FromRoutingID(int routing_id); | 36 static SynchronousCompositorImpl* FromRoutingID(int routing_id); |
| 37 | 37 |
| 38 InputEventAckState HandleInputEvent(const WebKit::WebInputEvent& input_event); | 38 InputEventAckState HandleInputEvent(const WebKit::WebInputEvent& input_event); |
| 39 | 39 |
| 40 // SynchronousCompositor | 40 // SynchronousCompositor |
| 41 virtual bool IsHwReady() OVERRIDE; | |
| 42 virtual void SetClient(SynchronousCompositorClient* compositor_client) | 41 virtual void SetClient(SynchronousCompositorClient* compositor_client) |
| 43 OVERRIDE; | 42 OVERRIDE; |
| 44 virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE; | 43 virtual bool InitializeHwDraw() OVERRIDE; |
| 45 virtual bool DemandDrawHw( | 44 virtual bool DemandDrawHw( |
| 46 gfx::Size view_size, | 45 gfx::Size view_size, |
| 47 const gfx::Transform& transform, | 46 const gfx::Transform& transform, |
| 48 gfx::Rect clip) OVERRIDE; | 47 gfx::Rect clip) OVERRIDE; |
| 48 virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE; |
| 49 | 49 |
| 50 // SynchronousCompositorOutputSurfaceDelegate | 50 // SynchronousCompositorOutputSurfaceDelegate |
| 51 virtual void DidBindOutputSurface( | 51 virtual void DidBindOutputSurface( |
| 52 SynchronousCompositorOutputSurface* output_surface) OVERRIDE; | 52 SynchronousCompositorOutputSurface* output_surface) OVERRIDE; |
| 53 virtual void DidDestroySynchronousOutputSurface( | 53 virtual void DidDestroySynchronousOutputSurface( |
| 54 SynchronousCompositorOutputSurface* output_surface) OVERRIDE; | 54 SynchronousCompositorOutputSurface* output_surface) OVERRIDE; |
| 55 virtual void SetContinuousInvalidate(bool enable) OVERRIDE; | 55 virtual void SetContinuousInvalidate(bool enable) OVERRIDE; |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 explicit SynchronousCompositorImpl(WebContents* contents); | 58 explicit SynchronousCompositorImpl(WebContents* contents); |
| 59 virtual ~SynchronousCompositorImpl(); | 59 virtual ~SynchronousCompositorImpl(); |
| 60 friend class WebContentsUserData<SynchronousCompositorImpl>; | 60 friend class WebContentsUserData<SynchronousCompositorImpl>; |
| 61 | 61 |
| 62 void DidCreateSynchronousOutputSurface( | 62 void DidCreateSynchronousOutputSurface( |
| 63 SynchronousCompositorOutputSurface* output_surface); | 63 SynchronousCompositorOutputSurface* output_surface); |
| 64 bool CalledOnValidThread() const; | 64 bool CalledOnValidThread() const; |
| 65 | 65 |
| 66 int routing_id_; | 66 int routing_id_; |
| 67 SynchronousCompositorClient* compositor_client_; | 67 SynchronousCompositorClient* compositor_client_; |
| 68 SynchronousCompositorOutputSurface* output_surface_; | 68 SynchronousCompositorOutputSurface* output_surface_; |
| 69 WebContents* contents_; | 69 WebContents* contents_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); | 71 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace content | 74 } // namespace content |
| 75 | 75 |
| 76 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 76 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
| OLD | NEW |