OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layers/render_surface_impl.h" | 5 #include "cc/layers/render_surface_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 } | 68 } |
69 | 69 |
70 RenderSurfaceImpl::DrawProperties::~DrawProperties() {} | 70 RenderSurfaceImpl::DrawProperties::~DrawProperties() {} |
71 | 71 |
72 gfx::RectF RenderSurfaceImpl::DrawableContentRect() const { | 72 gfx::RectF RenderSurfaceImpl::DrawableContentRect() const { |
73 if (content_rect().IsEmpty()) | 73 if (content_rect().IsEmpty()) |
74 return gfx::RectF(); | 74 return gfx::RectF(); |
75 | 75 |
76 gfx::Rect surface_content_rect = content_rect(); | 76 gfx::Rect surface_content_rect = content_rect(); |
77 if (!owning_layer_->filters().IsEmpty()) { | 77 if (!owning_layer_->filters().IsEmpty()) { |
78 int left, top, right, bottom; | 78 surface_content_rect = |
79 owning_layer_->filters().GetOutsets(&top, &right, &bottom, &left); | 79 owning_layer_->filters().MapRect(surface_content_rect, SkMatrix::I()); |
Stephen White
2016/06/01 17:17:38
Er, wait. Shouldn't we be using the filters_scale
jbroman
2016/06/01 19:38:00
I don't think so; I'd expect that the scale of fil
Stephen White
2016/06/01 22:13:12
It's not the rectangle that's the problem; it's th
jbroman
2016/06/06 17:16:59
Yes, but the rectangle isn't in device space yet a
| |
80 surface_content_rect.Inset(-left, -top, -right, -bottom); | |
jbroman
2016/05/27 17:43:48
Output of the test before this patch:
[ RUN
| |
81 } | 80 } |
82 gfx::RectF drawable_content_rect = MathUtil::MapClippedRect( | 81 gfx::RectF drawable_content_rect = MathUtil::MapClippedRect( |
83 draw_transform(), gfx::RectF(surface_content_rect)); | 82 draw_transform(), gfx::RectF(surface_content_rect)); |
84 if (owning_layer_->has_replica()) { | 83 if (owning_layer_->has_replica()) { |
85 drawable_content_rect.Union(MathUtil::MapClippedRect( | 84 drawable_content_rect.Union(MathUtil::MapClippedRect( |
86 replica_draw_transform(), gfx::RectF(surface_content_rect))); | 85 replica_draw_transform(), gfx::RectF(surface_content_rect))); |
87 } else if (!owning_layer_->filters().IsEmpty() && is_clipped()) { | 86 } else if (!owning_layer_->filters().IsEmpty() && is_clipped()) { |
88 // Filter could move pixels around, but still need to be clipped. | 87 // Filter could move pixels around, but still need to be clipped. |
89 drawable_content_rect.Intersect(gfx::RectF(clip_rect())); | 88 drawable_content_rect.Intersect(gfx::RectF(clip_rect())); |
90 } | 89 } |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
355 RenderPassDrawQuad* quad = | 354 RenderPassDrawQuad* quad = |
356 render_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); | 355 render_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); |
357 quad->SetNew(shared_quad_state, content_rect(), visible_layer_rect, | 356 quad->SetNew(shared_quad_state, content_rect(), visible_layer_rect, |
358 render_pass_id, mask_resource_id, mask_uv_scale, | 357 render_pass_id, mask_resource_id, mask_uv_scale, |
359 mask_texture_size, owning_layer_->filters(), | 358 mask_texture_size, owning_layer_->filters(), |
360 owning_layer_to_target_scale, | 359 owning_layer_to_target_scale, |
361 owning_layer_->background_filters()); | 360 owning_layer_->background_filters()); |
362 } | 361 } |
363 | 362 |
364 } // namespace cc | 363 } // namespace cc |
OLD | NEW |