Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Side by Side Diff: cc/render_surface.h

Issue 11308153: Migrate most of cc/ from WebKit::WebTransformationMatrix to gfx::Transform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch for landing Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/render_pass_unittest.cc ('k') | cc/render_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5
6 #ifndef CC_RENDER_SURFACE_H_ 6 #ifndef CC_RENDER_SURFACE_H_
7 #define CC_RENDER_SURFACE_H_ 7 #define CC_RENDER_SURFACE_H_
8 8
9 #include <vector>
10
9 #include "base/basictypes.h" 11 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "cc/cc_export.h"
11 #include "ui/gfx/rect.h" 14 #include "ui/gfx/rect.h"
12 #include "ui/gfx/rect_f.h" 15 #include "ui/gfx/rect_f.h"
13 #include <public/WebTransformationMatrix.h> 16 #include "ui/gfx/transform.h"
14 #include <vector>
15 #include "cc/cc_export.h"
16 17
17 namespace cc { 18 namespace cc {
18 19
19 class Layer; 20 class Layer;
20 21
21 class CC_EXPORT RenderSurface { 22 class CC_EXPORT RenderSurface {
22 public: 23 public:
23 explicit RenderSurface(Layer*); 24 explicit RenderSurface(Layer*);
24 ~RenderSurface(); 25 ~RenderSurface();
25 26
26 // Returns the rect that encloses the RenderSurfaceImpl including any reflec tion. 27 // Returns the rect that encloses the RenderSurfaceImpl including any reflec tion.
27 gfx::RectF drawableContentRect() const; 28 gfx::RectF drawableContentRect() const;
28 29
29 const gfx::Rect& contentRect() const { return m_contentRect; } 30 const gfx::Rect& contentRect() const { return m_contentRect; }
30 void setContentRect(const gfx::Rect& contentRect) { m_contentRect = contentR ect; } 31 void setContentRect(const gfx::Rect& contentRect) { m_contentRect = contentR ect; }
31 32
32 float drawOpacity() const { return m_drawOpacity; } 33 float drawOpacity() const { return m_drawOpacity; }
33 void setDrawOpacity(float drawOpacity) { m_drawOpacity = drawOpacity; } 34 void setDrawOpacity(float drawOpacity) { m_drawOpacity = drawOpacity; }
34 35
35 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } 36 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; }
36 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI sAnimating = drawOpacityIsAnimating; } 37 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI sAnimating = drawOpacityIsAnimating; }
37 38
38 // This goes from content space with the origin in the center of the rect be ing transformed to the target space with the origin in the top left of the 39 // This goes from content space with the origin in the center of the rect be ing transformed to the target space with the origin in the top left of the
39 // rect being transformed. Position the rect so that the origin is in the ce nter of it before applying this transform. 40 // rect being transformed. Position the rect so that the origin is in the ce nter of it before applying this transform.
40 const WebKit::WebTransformationMatrix& drawTransform() const { return m_draw Transform; } 41 const gfx::Transform& drawTransform() const { return m_drawTransform; }
41 void setDrawTransform(const WebKit::WebTransformationMatrix& drawTransform) { m_drawTransform = drawTransform; } 42 void setDrawTransform(const gfx::Transform& drawTransform) { m_drawTransform = drawTransform; }
42 43
43 const WebKit::WebTransformationMatrix& screenSpaceTransform() const { return m_screenSpaceTransform; } 44 const gfx::Transform& screenSpaceTransform() const { return m_screenSpaceTra nsform; }
44 void setScreenSpaceTransform(const WebKit::WebTransformationMatrix& screenSp aceTransform) { m_screenSpaceTransform = screenSpaceTransform; } 45 void setScreenSpaceTransform(const gfx::Transform& screenSpaceTransform) { m _screenSpaceTransform = screenSpaceTransform; }
45 46
46 const WebKit::WebTransformationMatrix& replicaDrawTransform() const { return m_replicaDrawTransform; } 47 const gfx::Transform& replicaDrawTransform() const { return m_replicaDrawTra nsform; }
47 void setReplicaDrawTransform(const WebKit::WebTransformationMatrix& replicaD rawTransform) { m_replicaDrawTransform = replicaDrawTransform; } 48 void setReplicaDrawTransform(const gfx::Transform& replicaDrawTransform) { m _replicaDrawTransform = replicaDrawTransform; }
48 49
49 const WebKit::WebTransformationMatrix& replicaScreenSpaceTransform() const { return m_replicaScreenSpaceTransform; } 50 const gfx::Transform& replicaScreenSpaceTransform() const { return m_replica ScreenSpaceTransform; }
50 void setReplicaScreenSpaceTransform(const WebKit::WebTransformationMatrix& r eplicaScreenSpaceTransform) { m_replicaScreenSpaceTransform = replicaScreenSpace Transform; } 51 void setReplicaScreenSpaceTransform(const gfx::Transform& replicaScreenSpace Transform) { m_replicaScreenSpaceTransform = replicaScreenSpaceTransform; }
51 52
52 bool targetSurfaceTransformsAreAnimating() const { return m_targetSurfaceTra nsformsAreAnimating; } 53 bool targetSurfaceTransformsAreAnimating() const { return m_targetSurfaceTra nsformsAreAnimating; }
53 void setTargetSurfaceTransformsAreAnimating(bool animating) { m_targetSurfac eTransformsAreAnimating = animating; } 54 void setTargetSurfaceTransformsAreAnimating(bool animating) { m_targetSurfac eTransformsAreAnimating = animating; }
54 bool screenSpaceTransformsAreAnimating() const { return m_screenSpaceTransfo rmsAreAnimating; } 55 bool screenSpaceTransformsAreAnimating() const { return m_screenSpaceTransfo rmsAreAnimating; }
55 void setScreenSpaceTransformsAreAnimating(bool animating) { m_screenSpaceTra nsformsAreAnimating = animating; } 56 void setScreenSpaceTransformsAreAnimating(bool animating) { m_screenSpaceTra nsformsAreAnimating = animating; }
56 57
57 bool isClipped() const { return m_isClipped; } 58 bool isClipped() const { return m_isClipped; }
58 void setIsClipped(bool isClipped) { m_isClipped = isClipped; } 59 void setIsClipped(bool isClipped) { m_isClipped = isClipped; }
59 60
60 const gfx::Rect& clipRect() const { return m_clipRect; } 61 const gfx::Rect& clipRect() const { return m_clipRect; }
(...skipping 12 matching lines...) Expand all
73 private: 74 private:
74 friend struct LayerIteratorActions; 75 friend struct LayerIteratorActions;
75 76
76 Layer* m_owningLayer; 77 Layer* m_owningLayer;
77 78
78 // Uses this surface's space. 79 // Uses this surface's space.
79 gfx::Rect m_contentRect; 80 gfx::Rect m_contentRect;
80 81
81 float m_drawOpacity; 82 float m_drawOpacity;
82 bool m_drawOpacityIsAnimating; 83 bool m_drawOpacityIsAnimating;
83 WebKit::WebTransformationMatrix m_drawTransform; 84 gfx::Transform m_drawTransform;
84 WebKit::WebTransformationMatrix m_screenSpaceTransform; 85 gfx::Transform m_screenSpaceTransform;
85 WebKit::WebTransformationMatrix m_replicaDrawTransform; 86 gfx::Transform m_replicaDrawTransform;
86 WebKit::WebTransformationMatrix m_replicaScreenSpaceTransform; 87 gfx::Transform m_replicaScreenSpaceTransform;
87 bool m_targetSurfaceTransformsAreAnimating; 88 bool m_targetSurfaceTransformsAreAnimating;
88 bool m_screenSpaceTransformsAreAnimating; 89 bool m_screenSpaceTransformsAreAnimating;
89 90
90 bool m_isClipped; 91 bool m_isClipped;
91 92
92 // Uses the space of the surface's target surface. 93 // Uses the space of the surface's target surface.
93 gfx::Rect m_clipRect; 94 gfx::Rect m_clipRect;
94 95
95 LayerList m_layerList; 96 LayerList m_layerList;
96 97
97 // The nearest ancestor target surface that will contain the contents of thi s surface, and that is going 98 // The nearest ancestor target surface that will contain the contents of thi s surface, and that is going
98 // to move pixels within the surface (such as with a blur). This can point t o itself. 99 // to move pixels within the surface (such as with a blur). This can point t o itself.
99 RenderSurface* m_nearestAncestorThatMovesPixels; 100 RenderSurface* m_nearestAncestorThatMovesPixels;
100 101
101 // For LayerIteratorActions 102 // For LayerIteratorActions
102 int m_targetRenderSurfaceLayerIndexHistory; 103 int m_targetRenderSurfaceLayerIndexHistory;
103 int m_currentLayerIndexHistory; 104 int m_currentLayerIndexHistory;
104 105
105 DISALLOW_COPY_AND_ASSIGN(RenderSurface); 106 DISALLOW_COPY_AND_ASSIGN(RenderSurface);
106 }; 107 };
107 108
108 } 109 }
109 #endif // CC_RENDER_SURFACE_H_ 110 #endif // CC_RENDER_SURFACE_H_
OLDNEW
« no previous file with comments | « cc/render_pass_unittest.cc ('k') | cc/render_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698