Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: cc/output/gl_renderer.cc

Issue 2156913003: Refactor CALayerOverlay to pull out CALayerOverlaySharedState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp36
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« cc/output/ca_layer_overlay.cc ('K') | « cc/output/ca_layer_overlay.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3634 matching lines...) Expand 10 before | Expand all | Expand 10 after
3645 GLfloat contents_rect[4] = { 3645 GLfloat contents_rect[4] = {
3646 ca_layer_overlay.contents_rect.x(), ca_layer_overlay.contents_rect.y(), 3646 ca_layer_overlay.contents_rect.x(), ca_layer_overlay.contents_rect.y(),
3647 ca_layer_overlay.contents_rect.width(), 3647 ca_layer_overlay.contents_rect.width(),
3648 ca_layer_overlay.contents_rect.height(), 3648 ca_layer_overlay.contents_rect.height(),
3649 }; 3649 };
3650 GLfloat bounds_rect[4] = { 3650 GLfloat bounds_rect[4] = {
3651 ca_layer_overlay.bounds_rect.x(), ca_layer_overlay.bounds_rect.y(), 3651 ca_layer_overlay.bounds_rect.x(), ca_layer_overlay.bounds_rect.y(),
3652 ca_layer_overlay.bounds_rect.width(), 3652 ca_layer_overlay.bounds_rect.width(),
3653 ca_layer_overlay.bounds_rect.height(), 3653 ca_layer_overlay.bounds_rect.height(),
3654 }; 3654 };
3655 GLboolean is_clipped = ca_layer_overlay.is_clipped; 3655 GLboolean is_clipped = ca_layer_overlay.shared_state->is_clipped;
3656 GLfloat clip_rect[4] = {ca_layer_overlay.clip_rect.x(), 3656 GLfloat clip_rect[4] = {ca_layer_overlay.shared_state->clip_rect.x(),
3657 ca_layer_overlay.clip_rect.y(), 3657 ca_layer_overlay.shared_state->clip_rect.y(),
3658 ca_layer_overlay.clip_rect.width(), 3658 ca_layer_overlay.shared_state->clip_rect.width(),
3659 ca_layer_overlay.clip_rect.height()}; 3659 ca_layer_overlay.shared_state->clip_rect.height()};
3660 GLint sorting_context_id = ca_layer_overlay.sorting_context_id; 3660 GLint sorting_context_id =
3661 ca_layer_overlay.shared_state->sorting_context_id;
3661 GLfloat transform[16]; 3662 GLfloat transform[16];
3662 ca_layer_overlay.transform.asColMajorf(transform); 3663 ca_layer_overlay.shared_state->transform.asColMajorf(transform);
3663 unsigned filter = GL_LINEAR; 3664 unsigned filter = GL_LINEAR;
3664 gl_->ScheduleCALayerCHROMIUM( 3665 gl_->ScheduleCALayerCHROMIUM(
3665 texture_id, contents_rect, ca_layer_overlay.opacity, 3666 texture_id, contents_rect, ca_layer_overlay.shared_state->opacity,
3666 ca_layer_overlay.background_color, ca_layer_overlay.edge_aa_mask, 3667 ca_layer_overlay.background_color, ca_layer_overlay.edge_aa_mask,
3667 bounds_rect, is_clipped, clip_rect, sorting_context_id, transform, 3668 bounds_rect, is_clipped, clip_rect, sorting_context_id, transform,
3668 filter); 3669 filter);
3669 } 3670 }
3670 } 3671 }
3671 3672
3672 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { 3673 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) {
3673 if (frame->overlay_list.empty()) 3674 if (frame->overlay_list.empty())
3674 return; 3675 return;
3675 3676
(...skipping 10 matching lines...) Expand all
3686 texture_id = pending_overlay_resources_.back()->texture_id(); 3687 texture_id = pending_overlay_resources_.back()->texture_id();
3687 } 3688 }
3688 3689
3689 context_support_->ScheduleOverlayPlane( 3690 context_support_->ScheduleOverlayPlane(
3690 overlay.plane_z_order, overlay.transform, texture_id, 3691 overlay.plane_z_order, overlay.transform, texture_id,
3691 ToNearestRect(overlay.display_rect), overlay.uv_rect); 3692 ToNearestRect(overlay.display_rect), overlay.uv_rect);
3692 } 3693 }
3693 } 3694 }
3694 3695
3695 } // namespace cc 3696 } // namespace cc
OLDNEW
« cc/output/ca_layer_overlay.cc ('K') | « cc/output/ca_layer_overlay.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698