| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 3550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3561 ca_layer_overlay.bounds_rect.height(), | 3561 ca_layer_overlay.bounds_rect.height(), |
| 3562 }; | 3562 }; |
| 3563 GLboolean is_clipped = ca_layer_overlay.is_clipped; | 3563 GLboolean is_clipped = ca_layer_overlay.is_clipped; |
| 3564 GLfloat clip_rect[4] = {ca_layer_overlay.clip_rect.x(), | 3564 GLfloat clip_rect[4] = {ca_layer_overlay.clip_rect.x(), |
| 3565 ca_layer_overlay.clip_rect.y(), | 3565 ca_layer_overlay.clip_rect.y(), |
| 3566 ca_layer_overlay.clip_rect.width(), | 3566 ca_layer_overlay.clip_rect.width(), |
| 3567 ca_layer_overlay.clip_rect.height()}; | 3567 ca_layer_overlay.clip_rect.height()}; |
| 3568 GLint sorting_context_id = ca_layer_overlay.sorting_context_id; | 3568 GLint sorting_context_id = ca_layer_overlay.sorting_context_id; |
| 3569 GLfloat transform[16]; | 3569 GLfloat transform[16]; |
| 3570 ca_layer_overlay.transform.asColMajorf(transform); | 3570 ca_layer_overlay.transform.asColMajorf(transform); |
| 3571 unsigned filter = 0; |
| 3571 gl_->ScheduleCALayerCHROMIUM( | 3572 gl_->ScheduleCALayerCHROMIUM( |
| 3572 texture_id, contents_rect, ca_layer_overlay.opacity, | 3573 texture_id, contents_rect, ca_layer_overlay.opacity, |
| 3573 ca_layer_overlay.background_color, ca_layer_overlay.edge_aa_mask, | 3574 ca_layer_overlay.background_color, ca_layer_overlay.edge_aa_mask, |
| 3574 bounds_rect, is_clipped, clip_rect, sorting_context_id, transform); | 3575 bounds_rect, is_clipped, clip_rect, sorting_context_id, transform, |
| 3576 filter); |
| 3575 } | 3577 } |
| 3576 } | 3578 } |
| 3577 | 3579 |
| 3578 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { | 3580 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { |
| 3579 if (!frame->overlay_list.size()) | 3581 if (!frame->overlay_list.size()) |
| 3580 return; | 3582 return; |
| 3581 | 3583 |
| 3582 OverlayCandidateList& overlays = frame->overlay_list; | 3584 OverlayCandidateList& overlays = frame->overlay_list; |
| 3583 for (const OverlayCandidate& overlay : overlays) { | 3585 for (const OverlayCandidate& overlay : overlays) { |
| 3584 unsigned texture_id = 0; | 3586 unsigned texture_id = 0; |
| 3585 if (overlay.use_output_surface_for_resource) { | 3587 if (overlay.use_output_surface_for_resource) { |
| 3586 texture_id = output_surface_->GetOverlayTextureId(); | 3588 texture_id = output_surface_->GetOverlayTextureId(); |
| 3587 DCHECK(texture_id || IsContextLost()); | 3589 DCHECK(texture_id || IsContextLost()); |
| 3588 } else { | 3590 } else { |
| 3589 pending_overlay_resources_.push_back( | 3591 pending_overlay_resources_.push_back( |
| 3590 base::WrapUnique(new ResourceProvider::ScopedReadLockGL( | 3592 base::WrapUnique(new ResourceProvider::ScopedReadLockGL( |
| 3591 resource_provider_, overlay.resource_id))); | 3593 resource_provider_, overlay.resource_id))); |
| 3592 texture_id = pending_overlay_resources_.back()->texture_id(); | 3594 texture_id = pending_overlay_resources_.back()->texture_id(); |
| 3593 } | 3595 } |
| 3594 | 3596 |
| 3595 context_support_->ScheduleOverlayPlane( | 3597 context_support_->ScheduleOverlayPlane( |
| 3596 overlay.plane_z_order, overlay.transform, texture_id, | 3598 overlay.plane_z_order, overlay.transform, texture_id, |
| 3597 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3599 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
| 3598 } | 3600 } |
| 3599 } | 3601 } |
| 3600 | 3602 |
| 3601 } // namespace cc | 3603 } // namespace cc |
| OLD | NEW |