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