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 3652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3663 unsigned filter = GL_LINEAR; | 3663 unsigned filter = GL_LINEAR; |
3664 gl_->ScheduleCALayerCHROMIUM( | 3664 gl_->ScheduleCALayerCHROMIUM( |
3665 texture_id, contents_rect, ca_layer_overlay.opacity, | 3665 texture_id, contents_rect, ca_layer_overlay.opacity, |
3666 ca_layer_overlay.background_color, ca_layer_overlay.edge_aa_mask, | 3666 ca_layer_overlay.background_color, ca_layer_overlay.edge_aa_mask, |
3667 bounds_rect, is_clipped, clip_rect, sorting_context_id, transform, | 3667 bounds_rect, is_clipped, clip_rect, sorting_context_id, transform, |
3668 filter); | 3668 filter); |
3669 } | 3669 } |
3670 } | 3670 } |
3671 | 3671 |
3672 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { | 3672 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { |
3673 if (!frame->overlay_list.size()) | 3673 if (frame->overlay_list.empty()) |
3674 return; | 3674 return; |
3675 | 3675 |
3676 OverlayCandidateList& overlays = frame->overlay_list; | 3676 OverlayCandidateList& overlays = frame->overlay_list; |
3677 for (const OverlayCandidate& overlay : overlays) { | 3677 for (const OverlayCandidate& overlay : overlays) { |
3678 unsigned texture_id = 0; | 3678 unsigned texture_id = 0; |
3679 if (overlay.use_output_surface_for_resource) { | 3679 if (overlay.use_output_surface_for_resource) { |
3680 texture_id = output_surface_->GetOverlayTextureId(); | 3680 texture_id = output_surface_->GetOverlayTextureId(); |
3681 DCHECK(texture_id || IsContextLost()); | 3681 DCHECK(texture_id || IsContextLost()); |
3682 } else { | 3682 } else { |
3683 pending_overlay_resources_.push_back( | 3683 pending_overlay_resources_.push_back( |
3684 base::WrapUnique(new ResourceProvider::ScopedReadLockGL( | 3684 base::WrapUnique(new ResourceProvider::ScopedReadLockGL( |
3685 resource_provider_, overlay.resource_id))); | 3685 resource_provider_, overlay.resource_id))); |
3686 texture_id = pending_overlay_resources_.back()->texture_id(); | 3686 texture_id = pending_overlay_resources_.back()->texture_id(); |
3687 } | 3687 } |
3688 | 3688 |
3689 context_support_->ScheduleOverlayPlane( | 3689 context_support_->ScheduleOverlayPlane( |
3690 overlay.plane_z_order, overlay.transform, texture_id, | 3690 overlay.plane_z_order, overlay.transform, texture_id, |
3691 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3691 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
3692 } | 3692 } |
3693 } | 3693 } |
3694 | 3694 |
3695 } // namespace cc | 3695 } // namespace cc |
OLD | NEW |