| 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/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.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 "cc/output_surface.h" | 14 #include "cc/output_surface.h" |
| 15 #include "cc/software_output_device.h" | 15 #include "cc/software_output_device.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class TaskRunner; | 18 class TaskRunner; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace IPC { | 21 namespace IPC { |
| 22 class ForwardingMessageFilter; | 22 class ForwardingMessageFilter; |
| 23 class Message; | 23 class Message; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace cc { |
| 27 class CompositorFrameAck; |
| 28 } |
| 29 |
| 26 namespace content { | 30 namespace content { |
| 27 | 31 |
| 28 // This class can be created only on the main thread, but then becomes pinned | 32 // This class can be created only on the main thread, but then becomes pinned |
| 29 // to a fixed thread when bindToClient is called. | 33 // to a fixed thread when bindToClient is called. |
| 30 class CompositorOutputSurface | 34 class CompositorOutputSurface |
| 31 : NON_EXPORTED_BASE(public cc::OutputSurface), | 35 : NON_EXPORTED_BASE(public cc::OutputSurface), |
| 32 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 36 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 33 public: | 37 public: |
| 34 static IPC::ForwardingMessageFilter* CreateFilter( | 38 static IPC::ForwardingMessageFilter* CreateFilter( |
| 35 base::TaskRunner* target_task_runner); | 39 base::TaskRunner* target_task_runner); |
| 36 | 40 |
| 37 CompositorOutputSurface(int32 routing_id, | 41 CompositorOutputSurface(int32 routing_id, |
| 38 WebKit::WebGraphicsContext3D* context3d, | 42 WebKit::WebGraphicsContext3D* context3d, |
| 39 cc::SoftwareOutputDevice* software); | 43 cc::SoftwareOutputDevice* software, |
| 44 bool renderToMailbox); |
| 40 virtual ~CompositorOutputSurface(); | 45 virtual ~CompositorOutputSurface(); |
| 41 | 46 |
| 42 // cc::OutputSurface implementation. | 47 // cc::OutputSurface implementation. |
| 43 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE; | 48 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE; |
| 44 virtual const struct Capabilities& Capabilities() const OVERRIDE; | 49 virtual const struct Capabilities& Capabilities() const OVERRIDE; |
| 45 virtual WebKit::WebGraphicsContext3D* Context3D() const OVERRIDE; | 50 virtual WebKit::WebGraphicsContext3D* Context3D() const OVERRIDE; |
| 46 virtual cc::SoftwareOutputDevice* SoftwareDevice() const OVERRIDE; | 51 virtual cc::SoftwareOutputDevice* SoftwareDevice() const OVERRIDE; |
| 47 virtual void SendFrameToParentCompositor(cc::CompositorFrame*) OVERRIDE; | 52 virtual void SendFrameToParentCompositor(cc::CompositorFrame*) OVERRIDE; |
| 48 | 53 |
| 49 private: | 54 private: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 63 friend class base::RefCountedThreadSafe<CompositorOutputSurfaceProxy>; | 68 friend class base::RefCountedThreadSafe<CompositorOutputSurfaceProxy>; |
| 64 ~CompositorOutputSurfaceProxy() {} | 69 ~CompositorOutputSurfaceProxy() {} |
| 65 CompositorOutputSurface* output_surface_; | 70 CompositorOutputSurface* output_surface_; |
| 66 | 71 |
| 67 DISALLOW_COPY_AND_ASSIGN(CompositorOutputSurfaceProxy); | 72 DISALLOW_COPY_AND_ASSIGN(CompositorOutputSurfaceProxy); |
| 68 }; | 73 }; |
| 69 | 74 |
| 70 void OnMessageReceived(const IPC::Message& message); | 75 void OnMessageReceived(const IPC::Message& message); |
| 71 void OnUpdateVSyncParameters( | 76 void OnUpdateVSyncParameters( |
| 72 base::TimeTicks timebase, base::TimeDelta interval); | 77 base::TimeTicks timebase, base::TimeDelta interval); |
| 78 void OnSwapAck(const cc::CompositorFrameAck& ack); |
| 73 bool Send(IPC::Message* message); | 79 bool Send(IPC::Message* message); |
| 74 | 80 |
| 75 scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_; | 81 scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_; |
| 76 cc::OutputSurfaceClient* client_; | 82 cc::OutputSurfaceClient* client_; |
| 77 scoped_refptr<CompositorOutputSurfaceProxy> output_surface_proxy_; | 83 scoped_refptr<CompositorOutputSurfaceProxy> output_surface_proxy_; |
| 78 int routing_id_; | 84 int routing_id_; |
| 79 struct Capabilities capabilities_; | 85 struct Capabilities capabilities_; |
| 80 scoped_ptr<WebKit::WebGraphicsContext3D> context3D_; | 86 scoped_ptr<WebKit::WebGraphicsContext3D> context3D_; |
| 81 scoped_ptr<cc::SoftwareOutputDevice> software_device_; | 87 scoped_ptr<cc::SoftwareOutputDevice> software_device_; |
| 82 }; | 88 }; |
| 83 | 89 |
| 84 } // namespace content | 90 } // namespace content |
| 85 | 91 |
| 86 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ | 92 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ |
| OLD | NEW |