| 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" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 pending_textures_.pop_front(); | 192 pending_textures_.pop_front(); |
| 193 } | 193 } |
| 194 CompositorOutputSurface::OnSwapAck(output_surface_id, ack); | 194 CompositorOutputSurface::OnSwapAck(output_surface_id, ack); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void MailboxOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { | 197 void MailboxOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { |
| 198 DCHECK(frame->gl_frame_data); | 198 DCHECK(frame->gl_frame_data); |
| 199 DCHECK(!surface_size_.IsEmpty()); | 199 DCHECK(!surface_size_.IsEmpty()); |
| 200 DCHECK(surface_size_ == current_backing_.size); | 200 DCHECK(surface_size_ == current_backing_.size); |
| 201 DCHECK(frame->gl_frame_data->size == current_backing_.size); | 201 DCHECK(frame->gl_frame_data->size == current_backing_.size); |
| 202 DCHECK(!current_backing_.mailbox.IsZero() || | 202 DCHECK_IMPLIES(current_backing_.mailbox.IsZero(), |
| 203 context_provider_->IsContextLost()); | 203 context_provider_->ContextGL()->GetGraphicsResetStatusKHR() != |
| 204 GL_NO_ERROR); |
| 204 | 205 |
| 205 frame->gl_frame_data->mailbox = current_backing_.mailbox; | 206 frame->gl_frame_data->mailbox = current_backing_.mailbox; |
| 206 context_provider_->ContextGL()->Flush(); | 207 context_provider_->ContextGL()->Flush(); |
| 207 frame->gl_frame_data->sync_point = | 208 frame->gl_frame_data->sync_point = |
| 208 context_provider_->ContextGL()->InsertSyncPointCHROMIUM(); | 209 context_provider_->ContextGL()->InsertSyncPointCHROMIUM(); |
| 209 CompositorOutputSurface::SwapBuffers(frame); | 210 CompositorOutputSurface::SwapBuffers(frame); |
| 210 | 211 |
| 211 pending_textures_.push_back(current_backing_); | 212 pending_textures_.push_back(current_backing_); |
| 212 current_backing_ = TransferableFrame(); | 213 current_backing_ = TransferableFrame(); |
| 213 } | 214 } |
| 214 | 215 |
| 215 size_t MailboxOutputSurface::GetNumAcksPending() { | 216 size_t MailboxOutputSurface::GetNumAcksPending() { |
| 216 DCHECK(pending_textures_.size()); | 217 DCHECK(pending_textures_.size()); |
| 217 return pending_textures_.size() - 1; | 218 return pending_textures_.size() - 1; |
| 218 } | 219 } |
| 219 | 220 |
| 220 } // namespace content | 221 } // namespace content |
| OLD | NEW |