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

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

Issue 1998233002: cc: Implement and use FilterOperations::MapRectReverse for mapping backdrop bounding box. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit test 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
« no previous file with comments | « cc/output/filter_operations_unittest.cc ('k') | cc/output/software_renderer.cc » ('j') | 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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 bool use_aa) { 793 bool use_aa) {
794 gfx::QuadF scaled_region; 794 gfx::QuadF scaled_region;
795 if (!GetScaledRegion(quad->rect, clip_region, &scaled_region)) { 795 if (!GetScaledRegion(quad->rect, clip_region, &scaled_region)) {
796 scaled_region = SharedGeometryQuad().BoundingBox(); 796 scaled_region = SharedGeometryQuad().BoundingBox();
797 } 797 }
798 798
799 gfx::Rect backdrop_rect = gfx::ToEnclosingRect(MathUtil::MapClippedRect( 799 gfx::Rect backdrop_rect = gfx::ToEnclosingRect(MathUtil::MapClippedRect(
800 contents_device_transform, scaled_region.BoundingBox())); 800 contents_device_transform, scaled_region.BoundingBox()));
801 801
802 if (ShouldApplyBackgroundFilters(quad)) { 802 if (ShouldApplyBackgroundFilters(quad)) {
803 int top, right, bottom, left; 803 SkMatrix matrix;
804 quad->background_filters.GetOutsets(&top, &right, &bottom, &left); 804 matrix.setScale(quad->filters_scale.x(), quad->filters_scale.y());
805 backdrop_rect.Inset(-left, -top, -right, -bottom); 805 if (FlippedFramebuffer(frame)) {
806 // TODO(jbroman): This probably isn't the right way to account for this.
807 // Probably some combination of frame->projection_matrix,
808 // frame->window_matrix and contents_device_transform?
809 matrix.postScale(1, -1);
810 }
811 backdrop_rect =
812 quad->background_filters.MapRectReverse(backdrop_rect, matrix);
806 } 813 }
807 814
808 if (!backdrop_rect.IsEmpty() && use_aa) { 815 if (!backdrop_rect.IsEmpty() && use_aa) {
809 const int kOutsetForAntialiasing = 1; 816 const int kOutsetForAntialiasing = 1;
810 backdrop_rect.Inset(-kOutsetForAntialiasing, -kOutsetForAntialiasing); 817 backdrop_rect.Inset(-kOutsetForAntialiasing, -kOutsetForAntialiasing);
811 } 818 }
812 819
813 if (!quad->filters.IsEmpty()) { 820 if (!quad->filters.IsEmpty()) {
814 // If we have filters, grab an extra one-pixel border around the 821 // If we have filters, grab an extra one-pixel border around the
815 // background, so texture edge clamping gives us a transparent border 822 // background, so texture edge clamping gives us a transparent border
(...skipping 2863 matching lines...) Expand 10 before | Expand all | Expand 10 after
3679 texture_id = pending_overlay_resources_.back()->texture_id(); 3686 texture_id = pending_overlay_resources_.back()->texture_id();
3680 } 3687 }
3681 3688
3682 context_support_->ScheduleOverlayPlane( 3689 context_support_->ScheduleOverlayPlane(
3683 overlay.plane_z_order, overlay.transform, texture_id, 3690 overlay.plane_z_order, overlay.transform, texture_id,
3684 ToNearestRect(overlay.display_rect), overlay.uv_rect); 3691 ToNearestRect(overlay.display_rect), overlay.uv_rect);
3685 } 3692 }
3686 } 3693 }
3687 3694
3688 } // namespace cc 3695 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/filter_operations_unittest.cc ('k') | cc/output/software_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698