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 #include "content/renderer/gpu/mailbox_output_surface.h" | 5 #include "content/renderer/gpu/mailbox_output_surface.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
9 #include "cc/output/compositor_frame_ack.h" | 9 #include "cc/output/compositor_frame_ack.h" |
10 #include "cc/output/gl_frame_data.h" | 10 #include "cc/output/gl_frame_data.h" |
11 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 11 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
12 #include "third_party/khronos/GLES2/gl2.h" | 12 #include "third_party/khronos/GLES2/gl2.h" |
13 #include "third_party/khronos/GLES2/gl2ext.h" | 13 #include "third_party/khronos/GLES2/gl2ext.h" |
14 | 14 |
15 using cc::CompositorFrame; | 15 using cc::CompositorFrame; |
16 using cc::GLFrameData; | 16 using cc::GLFrameData; |
17 using gpu::Mailbox; | 17 using gpu::Mailbox; |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 MailboxOutputSurface::MailboxOutputSurface( | 21 MailboxOutputSurface::MailboxOutputSurface( |
22 int32 routing_id, | 22 int32 routing_id, |
23 uint32 output_surface_id, | 23 uint32 output_surface_id, |
24 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, | 24 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, |
25 scoped_ptr<cc::SoftwareOutputDevice> software_device) | 25 scoped_ptr<cc::SoftwareOutputDevice> software_device, |
| 26 size_t max_transfer_buffer_usage_bytes) |
26 : CompositorOutputSurface(routing_id, | 27 : CompositorOutputSurface(routing_id, |
27 output_surface_id, | 28 output_surface_id, |
28 context_provider, | 29 context_provider, |
29 software_device.Pass(), | 30 software_device.Pass(), |
30 true), | 31 true, |
| 32 max_transfer_buffer_usage_bytes), |
31 fbo_(0), | 33 fbo_(0), |
32 is_backbuffer_discarded_(false) { | 34 is_backbuffer_discarded_(false) { |
33 pending_textures_.push_back(TransferableFrame()); | 35 pending_textures_.push_back(TransferableFrame()); |
34 capabilities_.max_frames_pending = 1; | 36 capabilities_.max_frames_pending = 1; |
35 } | 37 } |
36 | 38 |
37 MailboxOutputSurface::~MailboxOutputSurface() { | 39 MailboxOutputSurface::~MailboxOutputSurface() { |
38 DiscardBackbuffer(); | 40 DiscardBackbuffer(); |
39 while (!pending_textures_.empty()) { | 41 while (!pending_textures_.empty()) { |
40 if (pending_textures_.front().texture_id) { | 42 if (pending_textures_.front().texture_id) { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 pending_textures_.push_back(current_backing_); | 200 pending_textures_.push_back(current_backing_); |
199 current_backing_ = TransferableFrame(); | 201 current_backing_ = TransferableFrame(); |
200 } | 202 } |
201 | 203 |
202 size_t MailboxOutputSurface::GetNumAcksPending() { | 204 size_t MailboxOutputSurface::GetNumAcksPending() { |
203 DCHECK(pending_textures_.size()); | 205 DCHECK(pending_textures_.size()); |
204 return pending_textures_.size() - 1; | 206 return pending_textures_.size() - 1; |
205 } | 207 } |
206 | 208 |
207 } // namespace content | 209 } // namespace content |
OLD | NEW |