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

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: Created 4 years, 6 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
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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 bool use_aa) { 789 bool use_aa) {
790 gfx::QuadF scaled_region; 790 gfx::QuadF scaled_region;
791 if (!GetScaledRegion(quad->rect, clip_region, &scaled_region)) { 791 if (!GetScaledRegion(quad->rect, clip_region, &scaled_region)) {
792 scaled_region = SharedGeometryQuad().BoundingBox(); 792 scaled_region = SharedGeometryQuad().BoundingBox();
793 } 793 }
794 794
795 gfx::Rect backdrop_rect = gfx::ToEnclosingRect(MathUtil::MapClippedRect( 795 gfx::Rect backdrop_rect = gfx::ToEnclosingRect(MathUtil::MapClippedRect(
796 contents_device_transform, scaled_region.BoundingBox())); 796 contents_device_transform, scaled_region.BoundingBox()));
797 797
798 if (ShouldApplyBackgroundFilters(quad)) { 798 if (ShouldApplyBackgroundFilters(quad)) {
799 int top, right, bottom, left; 799 backdrop_rect =
800 quad->background_filters.GetOutsets(&top, &right, &bottom, &left); 800 quad->background_filters.MapRectReverse(backdrop_rect, SkMatrix::I());
Stephen White 2016/06/01 17:42:46 If these are device-space rects, shouldn't we be u
jbroman 2016/06/01 19:41:20 I believe you're correct, which would make that an
801 backdrop_rect.Inset(-left, -top, -right, -bottom);
802 } 801 }
803 802
804 if (!backdrop_rect.IsEmpty() && use_aa) { 803 if (!backdrop_rect.IsEmpty() && use_aa) {
805 const int kOutsetForAntialiasing = 1; 804 const int kOutsetForAntialiasing = 1;
806 backdrop_rect.Inset(-kOutsetForAntialiasing, -kOutsetForAntialiasing); 805 backdrop_rect.Inset(-kOutsetForAntialiasing, -kOutsetForAntialiasing);
807 } 806 }
808 807
809 if (!quad->filters.IsEmpty()) { 808 if (!quad->filters.IsEmpty()) {
810 // If we have filters, grab an extra one-pixel border around the 809 // If we have filters, grab an extra one-pixel border around the
811 // background, so texture edge clamping gives us a transparent border 810 // background, so texture edge clamping gives us a transparent border
(...skipping 2805 matching lines...) Expand 10 before | Expand all | Expand 10 after
3617 texture_id = pending_overlay_resources_.back()->texture_id(); 3616 texture_id = pending_overlay_resources_.back()->texture_id();
3618 } 3617 }
3619 3618
3620 context_support_->ScheduleOverlayPlane( 3619 context_support_->ScheduleOverlayPlane(
3621 overlay.plane_z_order, overlay.transform, texture_id, 3620 overlay.plane_z_order, overlay.transform, texture_id,
3622 ToNearestRect(overlay.display_rect), overlay.uv_rect); 3621 ToNearestRect(overlay.display_rect), overlay.uv_rect);
3623 } 3622 }
3624 } 3623 }
3625 3624
3626 } // namespace cc 3625 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698