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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 788 bool use_aa) { | 788 bool use_aa) { |
| 789 gfx::QuadF scaled_region; | 789 gfx::QuadF scaled_region; |
| 790 if (!GetScaledRegion(quad->rect, clip_region, &scaled_region)) { | 790 if (!GetScaledRegion(quad->rect, clip_region, &scaled_region)) { |
| 791 scaled_region = SharedGeometryQuad().BoundingBox(); | 791 scaled_region = SharedGeometryQuad().BoundingBox(); |
| 792 } | 792 } |
| 793 | 793 |
| 794 gfx::Rect backdrop_rect = gfx::ToEnclosingRect(MathUtil::MapClippedRect( | 794 gfx::Rect backdrop_rect = gfx::ToEnclosingRect(MathUtil::MapClippedRect( |
| 795 contents_device_transform, scaled_region.BoundingBox())); | 795 contents_device_transform, scaled_region.BoundingBox())); |
| 796 | 796 |
| 797 if (ShouldApplyBackgroundFilters(quad)) { | 797 if (ShouldApplyBackgroundFilters(quad)) { |
| 798 int top, right, bottom, left; | 798 SkMatrix matrix; |
| 799 quad->background_filters.GetOutsets(&top, &right, &bottom, &left); | 799 matrix.setScale(quad->filters_scale.x(), quad->filters_scale.y()); |
| 800 backdrop_rect.Inset(-left, -top, -right, -bottom); | 800 if (FlippedFramebuffer(frame)) { |
| 801 // TODO(jbroman): This probably isn't the right way to account for this. | |
| 802 // Probably some combination of frame->projection_matrix, | |
| 803 // frame->window_matrix and contents_device_transform? | |
| 804 matrix.postScale(1, -1); | |
|
Stephen White
2016/06/07 16:00:34
I'm not sure about this either.
| |
| 805 } | |
| 806 backdrop_rect = | |
| 807 quad->background_filters.MapRectReverse(backdrop_rect, matrix); | |
| 801 } | 808 } |
| 802 | 809 |
| 803 if (!backdrop_rect.IsEmpty() && use_aa) { | 810 if (!backdrop_rect.IsEmpty() && use_aa) { |
| 804 const int kOutsetForAntialiasing = 1; | 811 const int kOutsetForAntialiasing = 1; |
| 805 backdrop_rect.Inset(-kOutsetForAntialiasing, -kOutsetForAntialiasing); | 812 backdrop_rect.Inset(-kOutsetForAntialiasing, -kOutsetForAntialiasing); |
| 806 } | 813 } |
| 807 | 814 |
| 808 if (!quad->filters.IsEmpty()) { | 815 if (!quad->filters.IsEmpty()) { |
| 809 // If we have filters, grab an extra one-pixel border around the | 816 // If we have filters, grab an extra one-pixel border around the |
| 810 // background, so texture edge clamping gives us a transparent border | 817 // background, so texture edge clamping gives us a transparent border |
| (...skipping 2833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3644 texture_id = pending_overlay_resources_.back()->GetTextureId(); | 3651 texture_id = pending_overlay_resources_.back()->GetTextureId(); |
| 3645 } | 3652 } |
| 3646 | 3653 |
| 3647 context_support_->ScheduleOverlayPlane( | 3654 context_support_->ScheduleOverlayPlane( |
| 3648 overlay.plane_z_order, overlay.transform, texture_id, | 3655 overlay.plane_z_order, overlay.transform, texture_id, |
| 3649 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3656 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
| 3650 } | 3657 } |
| 3651 } | 3658 } |
| 3652 | 3659 |
| 3653 } // namespace cc | 3660 } // namespace cc |
| OLD | NEW |