| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 "cc/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 3497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3508 return gl_->GetGraphicsResetStatusKHR() != GL_NO_ERROR; | 3508 return gl_->GetGraphicsResetStatusKHR() != GL_NO_ERROR; |
| 3509 } | 3509 } |
| 3510 | 3510 |
| 3511 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { | 3511 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { |
| 3512 if (!frame->overlay_list.size()) | 3512 if (!frame->overlay_list.size()) |
| 3513 return; | 3513 return; |
| 3514 | 3514 |
| 3515 ResourceProvider::ResourceIdArray resources; | 3515 ResourceProvider::ResourceIdArray resources; |
| 3516 OverlayCandidateList& overlays = frame->overlay_list; | 3516 OverlayCandidateList& overlays = frame->overlay_list; |
| 3517 for (const OverlayCandidate& overlay : overlays) { | 3517 for (const OverlayCandidate& overlay : overlays) { |
| 3518 // Skip primary plane. | |
| 3519 if (overlay.plane_z_order == 0) | |
| 3520 continue; | |
| 3521 | |
| 3522 unsigned texture_id = 0; | 3518 unsigned texture_id = 0; |
| 3523 if (overlay.use_output_surface_for_resource) { | 3519 if (overlay.use_output_surface_for_resource) { |
| 3524 texture_id = output_surface_->GetOverlayTextureId(); | 3520 texture_id = output_surface_->GetOverlayTextureId(); |
| 3525 DCHECK(texture_id); | 3521 DCHECK(texture_id); |
| 3526 } else { | 3522 } else { |
| 3527 pending_overlay_resources_.push_back( | 3523 pending_overlay_resources_.push_back( |
| 3528 make_scoped_ptr(new ResourceProvider::ScopedReadLockGL( | 3524 make_scoped_ptr(new ResourceProvider::ScopedReadLockGL( |
| 3529 resource_provider_, overlay.resource_id))); | 3525 resource_provider_, overlay.resource_id))); |
| 3530 texture_id = pending_overlay_resources_.back()->texture_id(); | 3526 texture_id = pending_overlay_resources_.back()->texture_id(); |
| 3531 } | 3527 } |
| 3532 | 3528 |
| 3533 context_support_->ScheduleOverlayPlane( | 3529 context_support_->ScheduleOverlayPlane( |
| 3534 overlay.plane_z_order, overlay.transform, texture_id, | 3530 overlay.plane_z_order, overlay.transform, texture_id, |
| 3535 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3531 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
| 3536 } | 3532 } |
| 3537 } | 3533 } |
| 3538 | 3534 |
| 3539 } // namespace cc | 3535 } // namespace cc |
| OLD | NEW |