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; | 19 struct DidOverscrollParams; |
20 } | 20 } |
21 | 21 |
22 namespace WebKit { | 22 namespace blink { |
23 class WebInputEvent; | 23 class WebInputEvent; |
24 } | 24 } |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 class InputHandlerManager; | 27 class InputHandlerManager; |
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, |
38 public WebContentsUserData<SynchronousCompositorImpl> { | 38 public WebContentsUserData<SynchronousCompositorImpl> { |
39 public: | 39 public: |
40 // When used from browser code, use both |process_id| and |routing_id|. | 40 // When used from browser code, use both |process_id| and |routing_id|. |
41 static SynchronousCompositorImpl* FromID(int process_id, int routing_id); | 41 static SynchronousCompositorImpl* FromID(int process_id, int routing_id); |
42 // When handling upcalls from renderer code, use this version; the process id | 42 // When handling upcalls from renderer code, use this version; the process id |
43 // is implicitly that of the in-process renderer. | 43 // is implicitly that of the in-process renderer. |
44 static SynchronousCompositorImpl* FromRoutingID(int routing_id); | 44 static SynchronousCompositorImpl* FromRoutingID(int routing_id); |
45 | 45 |
46 InputEventAckState HandleInputEvent(const WebKit::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( |
55 gfx::Size surface_size, | 55 gfx::Size surface_size, |
56 const gfx::Transform& transform, | 56 const gfx::Transform& transform, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 SynchronousCompositorOutputSurface* output_surface_; | 96 SynchronousCompositorOutputSurface* output_surface_; |
97 WebContents* contents_; | 97 WebContents* contents_; |
98 cc::InputHandler* input_handler_; | 98 cc::InputHandler* input_handler_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); | 100 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace content | 103 } // namespace content |
104 | 104 |
105 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 105 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
OLD | NEW |