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/render_surface.h" | 5 #include "cc/render_surface.h" |
6 | 6 |
| 7 #include "cc/base/math_util.h" |
7 #include "cc/layer.h" | 8 #include "cc/layer.h" |
8 #include "cc/math_util.h" | |
9 #include "ui/gfx/transform.h" | 9 #include "ui/gfx/transform.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 RenderSurface::RenderSurface(Layer* owning_layer) | 13 RenderSurface::RenderSurface(Layer* owning_layer) |
14 : owning_layer_(owning_layer), | 14 : owning_layer_(owning_layer), |
15 draw_opacity_(1), | 15 draw_opacity_(1), |
16 draw_opacity_is_animating_(false), | 16 draw_opacity_is_animating_(false), |
17 target_surface_transforms_are_animating_(false), | 17 target_surface_transforms_are_animating_(false), |
18 screen_space_transforms_are_animating_(false), | 18 screen_space_transforms_are_animating_(false), |
19 is_clipped_(false), | 19 is_clipped_(false), |
20 nearest_ancestor_that_moves_pixels_(NULL) {} | 20 nearest_ancestor_that_moves_pixels_(NULL) {} |
21 | 21 |
22 RenderSurface::~RenderSurface() {} | 22 RenderSurface::~RenderSurface() {} |
23 | 23 |
24 gfx::RectF RenderSurface::DrawableContentRect() const { | 24 gfx::RectF RenderSurface::DrawableContentRect() const { |
25 gfx::RectF drawable_content_rect = | 25 gfx::RectF drawable_content_rect = |
26 MathUtil::mapClippedRect(draw_transform_, content_rect_); | 26 MathUtil::mapClippedRect(draw_transform_, content_rect_); |
27 if (owning_layer_->has_replica()) | 27 if (owning_layer_->has_replica()) |
28 drawable_content_rect.Union( | 28 drawable_content_rect.Union( |
29 MathUtil::mapClippedRect(replica_draw_transform_, content_rect_)); | 29 MathUtil::mapClippedRect(replica_draw_transform_, content_rect_)); |
30 return drawable_content_rect; | 30 return drawable_content_rect; |
31 } | 31 } |
32 | 32 |
33 } // namespace cc | 33 } // namespace cc |
OLD | NEW |