Chromium Code Reviews| 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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |