| 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 3481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3492 void GLRenderer::RestoreFramebuffer(DrawingFrame* frame) { | 3492 void GLRenderer::RestoreFramebuffer(DrawingFrame* frame) { |
| 3493 UseRenderPass(frame, frame->current_render_pass); | 3493 UseRenderPass(frame, frame->current_render_pass); |
| 3494 | 3494 |
| 3495 // Call SetViewport directly, rather than through PrepareSurfaceForPass. | 3495 // Call SetViewport directly, rather than through PrepareSurfaceForPass. |
| 3496 // PrepareSurfaceForPass also clears the surface, which is not desired when | 3496 // PrepareSurfaceForPass also clears the surface, which is not desired when |
| 3497 // restoring. | 3497 // restoring. |
| 3498 SetViewport(); | 3498 SetViewport(); |
| 3499 } | 3499 } |
| 3500 | 3500 |
| 3501 bool GLRenderer::IsContextLost() { | 3501 bool GLRenderer::IsContextLost() { |
| 3502 return output_surface_->context_provider()->IsContextLost(); | 3502 return gl_->GetGraphicsResetStatusKHR() != GL_NO_ERROR; |
| 3503 } | 3503 } |
| 3504 | 3504 |
| 3505 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { | 3505 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { |
| 3506 if (!frame->overlay_list.size()) | 3506 if (!frame->overlay_list.size()) |
| 3507 return; | 3507 return; |
| 3508 | 3508 |
| 3509 ResourceProvider::ResourceIdArray resources; | 3509 ResourceProvider::ResourceIdArray resources; |
| 3510 OverlayCandidateList& overlays = frame->overlay_list; | 3510 OverlayCandidateList& overlays = frame->overlay_list; |
| 3511 for (const OverlayCandidate& overlay : overlays) { | 3511 for (const OverlayCandidate& overlay : overlays) { |
| 3512 // Skip primary plane. | 3512 // Skip primary plane. |
| 3513 if (overlay.plane_z_order == 0) | 3513 if (overlay.plane_z_order == 0) |
| 3514 continue; | 3514 continue; |
| 3515 | 3515 |
| 3516 pending_overlay_resources_.push_back( | 3516 pending_overlay_resources_.push_back( |
| 3517 make_scoped_ptr(new ResourceProvider::ScopedReadLockGL( | 3517 make_scoped_ptr(new ResourceProvider::ScopedReadLockGL( |
| 3518 resource_provider_, overlay.resource_id))); | 3518 resource_provider_, overlay.resource_id))); |
| 3519 | 3519 |
| 3520 context_support_->ScheduleOverlayPlane( | 3520 context_support_->ScheduleOverlayPlane( |
| 3521 overlay.plane_z_order, | 3521 overlay.plane_z_order, |
| 3522 overlay.transform, | 3522 overlay.transform, |
| 3523 pending_overlay_resources_.back()->texture_id(), | 3523 pending_overlay_resources_.back()->texture_id(), |
| 3524 ToNearestRect(overlay.display_rect), | 3524 ToNearestRect(overlay.display_rect), |
| 3525 overlay.uv_rect); | 3525 overlay.uv_rect); |
| 3526 } | 3526 } |
| 3527 } | 3527 } |
| 3528 | 3528 |
| 3529 } // namespace cc | 3529 } // namespace cc |
| OLD | NEW |