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 "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" | 11 #include "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" |
| 12 #include "content/port/common/input_event_ack_state.h" |
12 #include "content/public/browser/android/synchronous_compositor.h" | 13 #include "content/public/browser/android/synchronous_compositor.h" |
13 #include "content/public/browser/web_contents_user_data.h" | 14 #include "content/public/browser/web_contents_user_data.h" |
14 | 15 |
| 16 namespace WebKit { |
| 17 class WebInputEvent; |
| 18 } |
| 19 |
15 namespace content { | 20 namespace content { |
16 | 21 |
17 // The purpose of this class is to act as the intermediary between the various | 22 // The purpose of this class is to act as the intermediary between the various |
18 // components that make up the 'synchronous compositor mode' implementation and | 23 // components that make up the 'synchronous compositor mode' implementation and |
19 // expose their functionality via the SynchronousCompositor interface. | 24 // expose their functionality via the SynchronousCompositor interface. |
20 // This class is created on the main thread but most of the APIs are called | 25 // This class is created on the main thread but most of the APIs are called |
21 // from the Compositor thread. | 26 // from the Compositor thread. |
22 class SynchronousCompositorImpl | 27 class SynchronousCompositorImpl |
23 : public SynchronousCompositor, | 28 : public SynchronousCompositor, |
24 public SynchronousCompositorOutputSurfaceDelegate, | 29 public SynchronousCompositorOutputSurfaceDelegate, |
25 public WebContentsUserData<SynchronousCompositorImpl> { | 30 public WebContentsUserData<SynchronousCompositorImpl> { |
26 public: | 31 public: |
| 32 // When used from browser code, use both |process_id| and |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 |
| 35 // is implicitly that of the in-process renderer. |
27 static SynchronousCompositorImpl* FromRoutingID(int routing_id); | 36 static SynchronousCompositorImpl* FromRoutingID(int routing_id); |
28 | 37 |
| 38 InputEventAckState HandleInputEvent(const WebKit::WebInputEvent& input_event); |
| 39 |
29 // SynchronousCompositor | 40 // SynchronousCompositor |
30 virtual bool IsHwReady() OVERRIDE; | 41 virtual bool IsHwReady() OVERRIDE; |
31 virtual void SetClient(SynchronousCompositorClient* compositor_client) | 42 virtual void SetClient(SynchronousCompositorClient* compositor_client) |
32 OVERRIDE; | 43 OVERRIDE; |
33 virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE; | 44 virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE; |
34 virtual bool DemandDrawHw( | 45 virtual bool DemandDrawHw( |
35 gfx::Size view_size, | 46 gfx::Size view_size, |
36 const gfx::Transform& transform, | 47 const gfx::Transform& transform, |
37 gfx::Rect clip) OVERRIDE; | 48 gfx::Rect clip) OVERRIDE; |
38 | 49 |
(...skipping 17 matching lines...) Expand all Loading... |
56 SynchronousCompositorClient* compositor_client_; | 67 SynchronousCompositorClient* compositor_client_; |
57 SynchronousCompositorOutputSurface* output_surface_; | 68 SynchronousCompositorOutputSurface* output_surface_; |
58 WebContents* contents_; | 69 WebContents* contents_; |
59 | 70 |
60 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); | 71 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorImpl); |
61 }; | 72 }; |
62 | 73 |
63 } // namespace content | 74 } // namespace content |
64 | 75 |
65 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ | 76 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_IMPL_H_ |
OLD | NEW |