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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 RenderSurfaceImpl::~RenderSurfaceImpl() {} | 44 RenderSurfaceImpl::~RenderSurfaceImpl() {} |
45 | 45 |
46 gfx::RectF RenderSurfaceImpl::DrawableContentRect() const { | 46 gfx::RectF RenderSurfaceImpl::DrawableContentRect() const { |
47 gfx::RectF drawable_content_rect = | 47 gfx::RectF drawable_content_rect = |
48 MathUtil::MapClippedRect(draw_transform_, gfx::RectF(content_rect_)); | 48 MathUtil::MapClippedRect(draw_transform_, gfx::RectF(content_rect_)); |
49 if (owning_layer_->has_replica()) { | 49 if (owning_layer_->has_replica()) { |
50 drawable_content_rect.Union(MathUtil::MapClippedRect( | 50 drawable_content_rect.Union(MathUtil::MapClippedRect( |
51 replica_draw_transform_, gfx::RectF(content_rect_))); | 51 replica_draw_transform_, gfx::RectF(content_rect_))); |
52 } | 52 } |
| 53 if (!owning_layer_->filters().IsEmpty()) { |
| 54 int left, top, right, bottom; |
| 55 owning_layer_->filters().GetOutsets(&top, &right, &bottom, &left); |
| 56 drawable_content_rect.Inset(-left, -top, -right, -bottom); |
| 57 } |
53 | 58 |
54 // If the rect has a NaN coordinate, we return empty rect to avoid crashes in | 59 // If the rect has a NaN coordinate, we return empty rect to avoid crashes in |
55 // functions (for example, gfx::ToEnclosedRect) that are called on this rect. | 60 // functions (for example, gfx::ToEnclosedRect) that are called on this rect. |
56 if (std::isnan(drawable_content_rect.x()) || | 61 if (std::isnan(drawable_content_rect.x()) || |
57 std::isnan(drawable_content_rect.y()) || | 62 std::isnan(drawable_content_rect.y()) || |
58 std::isnan(drawable_content_rect.right()) || | 63 std::isnan(drawable_content_rect.right()) || |
59 std::isnan(drawable_content_rect.bottom())) | 64 std::isnan(drawable_content_rect.bottom())) |
60 return gfx::RectF(); | 65 return gfx::RectF(); |
61 | 66 |
62 return drawable_content_rect; | 67 return drawable_content_rect; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 RenderPassDrawQuad* quad = | 255 RenderPassDrawQuad* quad = |
251 render_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); | 256 render_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); |
252 quad->SetNew(shared_quad_state, content_rect_, visible_layer_rect, | 257 quad->SetNew(shared_quad_state, content_rect_, visible_layer_rect, |
253 render_pass_id, mask_resource_id, mask_uv_scale, | 258 render_pass_id, mask_resource_id, mask_uv_scale, |
254 mask_texture_size, owning_layer_->filters(), | 259 mask_texture_size, owning_layer_->filters(), |
255 owning_layer_to_target_scale, | 260 owning_layer_to_target_scale, |
256 owning_layer_->background_filters()); | 261 owning_layer_->background_filters()); |
257 } | 262 } |
258 | 263 |
259 } // namespace cc | 264 } // namespace cc |
OLD | NEW |