OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ | 5 #ifndef CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ |
6 #define CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ | 6 #define CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_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 "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput
Surface.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput
Surface.h" |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSoftwa
reOutputDevice.h" |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class TaskRunner; | 18 class TaskRunner; |
18 } | 19 } |
19 | 20 |
20 namespace IPC { | 21 namespace IPC { |
21 class ForwardingMessageFilter; | 22 class ForwardingMessageFilter; |
22 class Message; | 23 class Message; |
23 class SyncChannel; | 24 class SyncChannel; |
24 } | 25 } |
25 | 26 |
26 // This class can be created only on the main thread, but then becomes pinned | 27 // This class can be created only on the main thread, but then becomes pinned |
27 // to a fixed thread when bindToClient is called. | 28 // to a fixed thread when bindToClient is called. |
28 class CompositorOutputSurface | 29 class CompositorOutputSurface |
29 : NON_EXPORTED_BASE(public WebKit::WebCompositorOutputSurface) | 30 : NON_EXPORTED_BASE(public WebKit::WebCompositorOutputSurface) |
30 , NON_EXPORTED_BASE(public base::NonThreadSafe) { | 31 , NON_EXPORTED_BASE(public base::NonThreadSafe) { |
31 public: | 32 public: |
32 static IPC::ForwardingMessageFilter* CreateFilter( | 33 static IPC::ForwardingMessageFilter* CreateFilter( |
33 base::TaskRunner* target_task_runner); | 34 base::TaskRunner* target_task_runner); |
34 | 35 |
35 CompositorOutputSurface(int32 routing_id, | 36 CompositorOutputSurface(int32 routing_id, |
36 WebKit::WebGraphicsContext3D* context3d); | 37 WebKit::WebGraphicsContext3D* context3d, |
| 38 WebKit::WebCompositorSoftwareOutputDevice* software); |
37 virtual ~CompositorOutputSurface(); | 39 virtual ~CompositorOutputSurface(); |
38 | 40 |
39 // WebCompositorOutputSurface implementation. | 41 // WebCompositorOutputSurface implementation. |
40 virtual bool bindToClient( | 42 virtual bool bindToClient( |
41 WebKit::WebCompositorOutputSurfaceClient* client) OVERRIDE; | 43 WebKit::WebCompositorOutputSurfaceClient* client) OVERRIDE; |
42 virtual const Capabilities& capabilities() const OVERRIDE; | 44 virtual const Capabilities& capabilities() const OVERRIDE; |
43 virtual WebKit::WebGraphicsContext3D* context3D() const OVERRIDE; | 45 virtual WebKit::WebGraphicsContext3D* context3D() const OVERRIDE; |
| 46 virtual WebKit::WebCompositorSoftwareOutputDevice* softwareDevice() const; |
44 virtual void sendFrameToParentCompositor( | 47 virtual void sendFrameToParentCompositor( |
45 const WebKit::WebCompositorFrame&) OVERRIDE; | 48 const WebKit::WebCompositorFrame&) OVERRIDE; |
46 | 49 |
47 private: | 50 private: |
48 void OnMessageReceived(const IPC::Message& message); | 51 void OnMessageReceived(const IPC::Message& message); |
49 void OnUpdateVSyncParameters( | 52 void OnUpdateVSyncParameters( |
50 base::TimeTicks timebase, base::TimeDelta interval); | 53 base::TimeTicks timebase, base::TimeDelta interval); |
51 | 54 |
52 scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_; | 55 scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_; |
53 WebKit::WebCompositorOutputSurfaceClient* client_; | 56 WebKit::WebCompositorOutputSurfaceClient* client_; |
54 int routing_id_; | 57 int routing_id_; |
55 Capabilities capabilities_; | 58 Capabilities capabilities_; |
56 scoped_ptr<WebKit::WebGraphicsContext3D> context3D_; | 59 scoped_ptr<WebKit::WebGraphicsContext3D> context3D_; |
| 60 scoped_ptr<WebKit::WebCompositorSoftwareOutputDevice> software_device_; |
57 }; | 61 }; |
58 | 62 |
59 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ | 63 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ |
60 | |
OLD | NEW |