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_isClipped(false) | 21 , m_isClipped(false) |
22 , m_nearestAncestorThatMovesPixels(0) | 22 , m_nearestAncestorThatMovesPixels(0) |
23 { | 23 { |
24 } | 24 } |
25 | 25 |
26 RenderSurface::~RenderSurface() | 26 RenderSurface::~RenderSurface() |
27 { | 27 { |
28 } | 28 } |
29 | 29 |
30 gfx::RectF RenderSurface::drawableContentRect() const | 30 gfx::RectF RenderSurface::drawableContentRect() const |
31 { | 31 { |
32 gfx::RectF drawableContentRect = MathUtil::mapClippedRect(m_drawTransform, m
_contentRect); | 32 gfx::RectF drawableContentRect = MathUtil::mapClippedRect(m_drawTransform, m
_contentRect); |
33 if (m_owningLayer->hasReplica()) | 33 if (m_owningLayer->hasReplica()) |
34 drawableContentRect.Union(MathUtil::mapClippedRect(m_replicaDrawTransfor
m, m_contentRect)); | 34 drawableContentRect.Union(MathUtil::mapClippedRect(m_replicaDrawTransfor
m, m_contentRect)); |
35 return drawableContentRect; | 35 return drawableContentRect; |
36 } | 36 } |
37 | 37 |
38 } // namespace cc | 38 } // namespace cc |
OLD | NEW |