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 "cc/resources/resource_provider.h" | 11 #include "cc/resources/resource_provider.h" |
| 12 #include "content/renderer/gpu/frame_swap_message_queue.h" |
12 #include "gpu/command_buffer/client/gles2_interface.h" | 13 #include "gpu/command_buffer/client/gles2_interface.h" |
13 #include "third_party/khronos/GLES2/gl2.h" | 14 #include "third_party/khronos/GLES2/gl2.h" |
14 #include "third_party/khronos/GLES2/gl2ext.h" | 15 #include "third_party/khronos/GLES2/gl2ext.h" |
15 | 16 |
16 using cc::CompositorFrame; | 17 using cc::CompositorFrame; |
17 using cc::GLFrameData; | 18 using cc::GLFrameData; |
18 using cc::ResourceProvider; | 19 using cc::ResourceProvider; |
19 using gpu::Mailbox; | 20 using gpu::Mailbox; |
20 using gpu::gles2::GLES2Interface; | 21 using gpu::gles2::GLES2Interface; |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 | 24 |
24 MailboxOutputSurface::MailboxOutputSurface( | 25 MailboxOutputSurface::MailboxOutputSurface( |
25 int32 routing_id, | 26 int32 routing_id, |
26 uint32 output_surface_id, | 27 uint32 output_surface_id, |
27 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, | 28 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, |
28 scoped_ptr<cc::SoftwareOutputDevice> software_device, | 29 scoped_ptr<cc::SoftwareOutputDevice> software_device, |
| 30 scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue, |
29 cc::ResourceFormat format) | 31 cc::ResourceFormat format) |
30 : CompositorOutputSurface(routing_id, | 32 : CompositorOutputSurface(routing_id, |
31 output_surface_id, | 33 output_surface_id, |
32 context_provider, | 34 context_provider, |
33 software_device.Pass(), | 35 software_device.Pass(), |
| 36 swap_frame_message_queue, |
34 true), | 37 true), |
35 fbo_(0), | 38 fbo_(0), |
36 is_backbuffer_discarded_(false), | 39 is_backbuffer_discarded_(false), |
37 format_(format) { | 40 format_(format) { |
38 pending_textures_.push_back(TransferableFrame()); | 41 pending_textures_.push_back(TransferableFrame()); |
39 capabilities_.max_frames_pending = 1; | 42 capabilities_.max_frames_pending = 1; |
40 capabilities_.uses_default_gl_framebuffer = false; | 43 capabilities_.uses_default_gl_framebuffer = false; |
41 } | 44 } |
42 | 45 |
43 MailboxOutputSurface::~MailboxOutputSurface() { | 46 MailboxOutputSurface::~MailboxOutputSurface() { |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 pending_textures_.push_back(current_backing_); | 209 pending_textures_.push_back(current_backing_); |
207 current_backing_ = TransferableFrame(); | 210 current_backing_ = TransferableFrame(); |
208 } | 211 } |
209 | 212 |
210 size_t MailboxOutputSurface::GetNumAcksPending() { | 213 size_t MailboxOutputSurface::GetNumAcksPending() { |
211 DCHECK(pending_textures_.size()); | 214 DCHECK(pending_textures_.size()); |
212 return pending_textures_.size() - 1; | 215 return pending_textures_.size() - 1; |
213 } | 216 } |
214 | 217 |
215 } // namespace content | 218 } // namespace content |
OLD | NEW |