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