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_MAILBOX_OUTPUT_SURFACE_H_ | 5 #ifndef CONTENT_RENDERER_GPU_MAILBOX_OUTPUT_SURFACE_H_ |
6 #define CONTENT_RENDERER_GPU_MAILBOX_OUTPUT_SURFACE_H_ | 6 #define CONTENT_RENDERER_GPU_MAILBOX_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
| 10 #include "base/memory/ref_counted.h" |
10 #include "cc/resources/resource_format.h" | 11 #include "cc/resources/resource_format.h" |
11 #include "cc/resources/transferable_resource.h" | 12 #include "cc/resources/transferable_resource.h" |
12 #include "content/renderer/gpu/compositor_output_surface.h" | 13 #include "content/renderer/gpu/compositor_output_surface.h" |
13 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
14 | 15 |
15 namespace cc { | 16 namespace cc { |
16 class CompositorFrameAck; | 17 class CompositorFrameAck; |
17 } | 18 } |
18 | 19 |
19 namespace content { | 20 namespace content { |
| 21 class FrameSwapMessageQueue; |
20 | 22 |
21 // Implementation of CompositorOutputSurface that renders to textures which | 23 // Implementation of CompositorOutputSurface that renders to textures which |
22 // are sent to the browser through the mailbox extension. | 24 // are sent to the browser through the mailbox extension. |
23 // This class can be created only on the main thread, but then becomes pinned | 25 // This class can be created only on the main thread, but then becomes pinned |
24 // to a fixed thread when bindToClient is called. | 26 // to a fixed thread when bindToClient is called. |
25 class MailboxOutputSurface : public CompositorOutputSurface { | 27 class MailboxOutputSurface : public CompositorOutputSurface { |
26 public: | 28 public: |
27 MailboxOutputSurface( | 29 MailboxOutputSurface( |
28 int32 routing_id, | 30 int32 routing_id, |
29 uint32 output_surface_id, | 31 uint32 output_surface_id, |
30 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, | 32 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, |
31 scoped_ptr<cc::SoftwareOutputDevice> software_device, | 33 scoped_ptr<cc::SoftwareOutputDevice> software_device, |
| 34 scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue, |
32 cc::ResourceFormat format); | 35 cc::ResourceFormat format); |
33 virtual ~MailboxOutputSurface(); | 36 virtual ~MailboxOutputSurface(); |
34 | 37 |
35 // cc::OutputSurface implementation. | 38 // cc::OutputSurface implementation. |
36 virtual void EnsureBackbuffer() OVERRIDE; | 39 virtual void EnsureBackbuffer() OVERRIDE; |
37 virtual void DiscardBackbuffer() OVERRIDE; | 40 virtual void DiscardBackbuffer() OVERRIDE; |
38 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; | 41 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; |
39 virtual void BindFramebuffer() OVERRIDE; | 42 virtual void BindFramebuffer() OVERRIDE; |
40 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; | 43 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; |
41 | 44 |
(...skipping 23 matching lines...) Expand all Loading... |
65 std::queue<TransferableFrame> returned_textures_; | 68 std::queue<TransferableFrame> returned_textures_; |
66 | 69 |
67 uint32 fbo_; | 70 uint32 fbo_; |
68 bool is_backbuffer_discarded_; | 71 bool is_backbuffer_discarded_; |
69 cc::ResourceFormat format_; | 72 cc::ResourceFormat format_; |
70 }; | 73 }; |
71 | 74 |
72 } // namespace content | 75 } // namespace content |
73 | 76 |
74 #endif // CONTENT_RENDERER_GPU_MAILBOX_OUTPUT_SURFACE_H_ | 77 #endif // CONTENT_RENDERER_GPU_MAILBOX_OUTPUT_SURFACE_H_ |
OLD | NEW |