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