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/layer.h" | 7 #include "cc/layer.h" |
8 #include "cc/math_util.h" | 8 #include "cc/math_util.h" |
9 #include <public/WebTransformationMatrix.h> | 9 #include "ui/gfx/transform.h" |
10 | 10 |
11 using WebKit::WebTransformationMatrix; | 11 using gfx::Transform; |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 RenderSurface::RenderSurface(Layer* owningLayer) | 15 RenderSurface::RenderSurface(Layer* owningLayer) |
16 : m_owningLayer(owningLayer) | 16 : m_owningLayer(owningLayer) |
17 , m_drawOpacity(1) | 17 , m_drawOpacity(1) |
18 , m_drawOpacityIsAnimating(false) | 18 , m_drawOpacityIsAnimating(false) |
19 , m_targetSurfaceTransformsAreAnimating(false) | 19 , m_targetSurfaceTransformsAreAnimating(false) |
20 , m_screenSpaceTransformsAreAnimating(false) | 20 , m_screenSpaceTransformsAreAnimating(false) |
21 , m_nearestAncestorThatMovesPixels(0) | 21 , m_nearestAncestorThatMovesPixels(0) |
22 { | 22 { |
23 } | 23 } |
24 | 24 |
25 RenderSurface::~RenderSurface() | 25 RenderSurface::~RenderSurface() |
26 { | 26 { |
27 } | 27 } |
28 | 28 |
29 gfx::RectF RenderSurface::drawableContentRect() const | 29 gfx::RectF RenderSurface::drawableContentRect() const |
30 { | 30 { |
31 gfx::RectF drawableContentRect = MathUtil::mapClippedRect(m_drawTransform, m
_contentRect); | 31 gfx::RectF drawableContentRect = MathUtil::mapClippedRect(m_drawTransform, m
_contentRect); |
32 if (m_owningLayer->hasReplica()) | 32 if (m_owningLayer->hasReplica()) |
33 drawableContentRect.Union(MathUtil::mapClippedRect(m_replicaDrawTransfor
m, m_contentRect)); | 33 drawableContentRect.Union(MathUtil::mapClippedRect(m_replicaDrawTransfor
m, m_contentRect)); |
34 return drawableContentRect; | 34 return drawableContentRect; |
35 } | 35 } |
36 | 36 |
37 } // namespace cc | 37 } // namespace cc |
OLD | NEW |