| 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 3595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3606 ca_layer_overlay.bounds_rect.height(), | 3606 ca_layer_overlay.bounds_rect.height(), |
| 3607 }; | 3607 }; |
| 3608 GLboolean is_clipped = ca_layer_overlay.is_clipped; | 3608 GLboolean is_clipped = ca_layer_overlay.is_clipped; |
| 3609 GLfloat clip_rect[4] = {ca_layer_overlay.clip_rect.x(), | 3609 GLfloat clip_rect[4] = {ca_layer_overlay.clip_rect.x(), |
| 3610 ca_layer_overlay.clip_rect.y(), | 3610 ca_layer_overlay.clip_rect.y(), |
| 3611 ca_layer_overlay.clip_rect.width(), | 3611 ca_layer_overlay.clip_rect.width(), |
| 3612 ca_layer_overlay.clip_rect.height()}; | 3612 ca_layer_overlay.clip_rect.height()}; |
| 3613 GLint sorting_context_id = ca_layer_overlay.sorting_context_id; | 3613 GLint sorting_context_id = ca_layer_overlay.sorting_context_id; |
| 3614 GLfloat transform[16]; | 3614 GLfloat transform[16]; |
| 3615 ca_layer_overlay.transform.asColMajorf(transform); | 3615 ca_layer_overlay.transform.asColMajorf(transform); |
| 3616 unsigned filter = GL_LINEAR; |
| 3616 gl_->ScheduleCALayerCHROMIUM( | 3617 gl_->ScheduleCALayerCHROMIUM( |
| 3617 texture_id, contents_rect, ca_layer_overlay.opacity, | 3618 texture_id, contents_rect, ca_layer_overlay.opacity, |
| 3618 ca_layer_overlay.background_color, ca_layer_overlay.edge_aa_mask, | 3619 ca_layer_overlay.background_color, ca_layer_overlay.edge_aa_mask, |
| 3619 bounds_rect, is_clipped, clip_rect, sorting_context_id, transform); | 3620 bounds_rect, is_clipped, clip_rect, sorting_context_id, transform, |
| 3621 filter); |
| 3620 } | 3622 } |
| 3621 } | 3623 } |
| 3622 | 3624 |
| 3623 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { | 3625 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { |
| 3624 if (!frame->overlay_list.size()) | 3626 if (!frame->overlay_list.size()) |
| 3625 return; | 3627 return; |
| 3626 | 3628 |
| 3627 OverlayCandidateList& overlays = frame->overlay_list; | 3629 OverlayCandidateList& overlays = frame->overlay_list; |
| 3628 for (const OverlayCandidate& overlay : overlays) { | 3630 for (const OverlayCandidate& overlay : overlays) { |
| 3629 unsigned texture_id = 0; | 3631 unsigned texture_id = 0; |
| 3630 if (overlay.use_output_surface_for_resource) { | 3632 if (overlay.use_output_surface_for_resource) { |
| 3631 texture_id = output_surface_->GetOverlayTextureId(); | 3633 texture_id = output_surface_->GetOverlayTextureId(); |
| 3632 DCHECK(texture_id || IsContextLost()); | 3634 DCHECK(texture_id || IsContextLost()); |
| 3633 } else { | 3635 } else { |
| 3634 pending_overlay_resources_.push_back( | 3636 pending_overlay_resources_.push_back( |
| 3635 base::WrapUnique(new ResourceProvider::ScopedReadLockGL( | 3637 base::WrapUnique(new ResourceProvider::ScopedReadLockGL( |
| 3636 resource_provider_, overlay.resource_id))); | 3638 resource_provider_, overlay.resource_id))); |
| 3637 texture_id = pending_overlay_resources_.back()->texture_id(); | 3639 texture_id = pending_overlay_resources_.back()->texture_id(); |
| 3638 } | 3640 } |
| 3639 | 3641 |
| 3640 context_support_->ScheduleOverlayPlane( | 3642 context_support_->ScheduleOverlayPlane( |
| 3641 overlay.plane_z_order, overlay.transform, texture_id, | 3643 overlay.plane_z_order, overlay.transform, texture_id, |
| 3642 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3644 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
| 3643 } | 3645 } |
| 3644 } | 3646 } |
| 3645 | 3647 |
| 3646 } // namespace cc | 3648 } // namespace cc |
| OLD | NEW |