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 const gfx::Transform& owning_layer_draw_transform = |
79 owning_layer_->filters().GetOutsets(&top, &right, &bottom, &left); | 79 owning_layer_->DrawTransform(); |
jbroman
2016/06/06 17:16:59
using the owning layer's draw transform is how Ren
| |
80 surface_content_rect.Inset(-left, -top, -right, -bottom); | 80 DCHECK(owning_layer_draw_transform.IsScale2d()); |
81 surface_content_rect = owning_layer_->filters().MapRect( | |
82 surface_content_rect, owning_layer_draw_transform.matrix()); | |
81 } | 83 } |
82 gfx::RectF drawable_content_rect = MathUtil::MapClippedRect( | 84 gfx::RectF drawable_content_rect = MathUtil::MapClippedRect( |
83 draw_transform(), gfx::RectF(surface_content_rect)); | 85 draw_transform(), gfx::RectF(surface_content_rect)); |
84 if (owning_layer_->has_replica()) { | 86 if (owning_layer_->has_replica()) { |
85 drawable_content_rect.Union(MathUtil::MapClippedRect( | 87 drawable_content_rect.Union(MathUtil::MapClippedRect( |
86 replica_draw_transform(), gfx::RectF(surface_content_rect))); | 88 replica_draw_transform(), gfx::RectF(surface_content_rect))); |
87 } else if (!owning_layer_->filters().IsEmpty() && is_clipped()) { | 89 } else if (!owning_layer_->filters().IsEmpty() && is_clipped()) { |
88 // Filter could move pixels around, but still need to be clipped. | 90 // Filter could move pixels around, but still need to be clipped. |
89 drawable_content_rect.Intersect(gfx::RectF(clip_rect())); | 91 drawable_content_rect.Intersect(gfx::RectF(clip_rect())); |
90 } | 92 } |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 RenderPassDrawQuad* quad = | 363 RenderPassDrawQuad* quad = |
362 render_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); | 364 render_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); |
363 quad->SetNew(shared_quad_state, content_rect(), visible_layer_rect, | 365 quad->SetNew(shared_quad_state, content_rect(), visible_layer_rect, |
364 render_pass_id, mask_resource_id, mask_uv_scale, | 366 render_pass_id, mask_resource_id, mask_uv_scale, |
365 mask_texture_size, owning_layer_->filters(), | 367 mask_texture_size, owning_layer_->filters(), |
366 owning_layer_to_target_scale, | 368 owning_layer_to_target_scale, |
367 owning_layer_->background_filters()); | 369 owning_layer_->background_filters()); |
368 } | 370 } |
369 | 371 |
370 } // namespace cc | 372 } // namespace cc |
OLD | NEW |