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 | 5 |
6 #ifndef RenderSurfaceChromium_h | 6 #ifndef RenderSurfaceChromium_h |
7 #define RenderSurfaceChromium_h | 7 #define RenderSurfaceChromium_h |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "FloatRect.h" | 11 #include "FloatRect.h" |
12 #include "IntRect.h" | 12 #include "IntRect.h" |
13 #include <public/WebTransformationMatrix.h> | 13 #include <public/WebTransformationMatrix.h> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 | 17 |
18 class LayerChromium; | 18 class Layer; |
19 | 19 |
20 class RenderSurfaceChromium { | 20 class RenderSurface { |
21 public: | 21 public: |
22 explicit RenderSurfaceChromium(LayerChromium*); | 22 explicit RenderSurface(Layer*); |
23 ~RenderSurfaceChromium(); | 23 ~RenderSurface(); |
24 | 24 |
25 // Returns the rect that encloses the RenderSurface including any reflection
. | 25 // Returns the rect that encloses the RenderSurfaceImpl including any reflec
tion. |
26 FloatRect drawableContentRect() const; | 26 FloatRect drawableContentRect() const; |
27 | 27 |
28 const IntRect& contentRect() const { return m_contentRect; } | 28 const IntRect& contentRect() const { return m_contentRect; } |
29 void setContentRect(const IntRect& contentRect) { m_contentRect = contentRec
t; } | 29 void setContentRect(const IntRect& contentRect) { m_contentRect = contentRec
t; } |
30 | 30 |
31 float drawOpacity() const { return m_drawOpacity; } | 31 float drawOpacity() const { return m_drawOpacity; } |
32 void setDrawOpacity(float drawOpacity) { m_drawOpacity = drawOpacity; } | 32 void setDrawOpacity(float drawOpacity) { m_drawOpacity = drawOpacity; } |
33 | 33 |
34 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } | 34 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } |
35 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } | 35 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } |
(...skipping 13 matching lines...) Expand all Loading... |
49 void setReplicaScreenSpaceTransform(const WebKit::WebTransformationMatrix& r
eplicaScreenSpaceTransform) { m_replicaScreenSpaceTransform = replicaScreenSpace
Transform; } | 49 void setReplicaScreenSpaceTransform(const WebKit::WebTransformationMatrix& r
eplicaScreenSpaceTransform) { m_replicaScreenSpaceTransform = replicaScreenSpace
Transform; } |
50 | 50 |
51 bool targetSurfaceTransformsAreAnimating() const { return m_targetSurfaceTra
nsformsAreAnimating; } | 51 bool targetSurfaceTransformsAreAnimating() const { return m_targetSurfaceTra
nsformsAreAnimating; } |
52 void setTargetSurfaceTransformsAreAnimating(bool animating) { m_targetSurfac
eTransformsAreAnimating = animating; } | 52 void setTargetSurfaceTransformsAreAnimating(bool animating) { m_targetSurfac
eTransformsAreAnimating = animating; } |
53 bool screenSpaceTransformsAreAnimating() const { return m_screenSpaceTransfo
rmsAreAnimating; } | 53 bool screenSpaceTransformsAreAnimating() const { return m_screenSpaceTransfo
rmsAreAnimating; } |
54 void setScreenSpaceTransformsAreAnimating(bool animating) { m_screenSpaceTra
nsformsAreAnimating = animating; } | 54 void setScreenSpaceTransformsAreAnimating(bool animating) { m_screenSpaceTra
nsformsAreAnimating = animating; } |
55 | 55 |
56 const IntRect& clipRect() const { return m_clipRect; } | 56 const IntRect& clipRect() const { return m_clipRect; } |
57 void setClipRect(const IntRect& clipRect) { m_clipRect = clipRect; } | 57 void setClipRect(const IntRect& clipRect) { m_clipRect = clipRect; } |
58 | 58 |
59 typedef std::vector<scoped_refptr<LayerChromium> > LayerList; | 59 typedef std::vector<scoped_refptr<Layer> > LayerList; |
60 LayerList& layerList() { return m_layerList; } | 60 LayerList& layerList() { return m_layerList; } |
61 // A no-op since DelegatedRendererLayers on the main thread don't have any | 61 // A no-op since DelegatedRendererLayers on the main thread don't have any |
62 // RenderPasses so they can't contribute to a surface. | 62 // RenderPasses so they can't contribute to a surface. |
63 void addContributingDelegatedRenderPassLayer(LayerChromium*) { } | 63 void addContributingDelegatedRenderPassLayer(Layer*) { } |
64 void clearLayerLists() { m_layerList.clear(); } | 64 void clearLayerLists() { m_layerList.clear(); } |
65 | 65 |
66 void setNearestAncestorThatMovesPixels(RenderSurfaceChromium* surface) { m_n
earestAncestorThatMovesPixels = surface; } | 66 void setNearestAncestorThatMovesPixels(RenderSurface* surface) { m_nearestAn
cestorThatMovesPixels = surface; } |
67 const RenderSurfaceChromium* nearestAncestorThatMovesPixels() const { return
m_nearestAncestorThatMovesPixels; } | 67 const RenderSurface* nearestAncestorThatMovesPixels() const { return m_neare
stAncestorThatMovesPixels; } |
68 | 68 |
69 private: | 69 private: |
70 friend struct CCLayerIteratorActions; | 70 friend struct LayerIteratorActions; |
71 | 71 |
72 LayerChromium* m_owningLayer; | 72 Layer* m_owningLayer; |
73 | 73 |
74 // Uses this surface's space. | 74 // Uses this surface's space. |
75 IntRect m_contentRect; | 75 IntRect m_contentRect; |
76 | 76 |
77 float m_drawOpacity; | 77 float m_drawOpacity; |
78 bool m_drawOpacityIsAnimating; | 78 bool m_drawOpacityIsAnimating; |
79 WebKit::WebTransformationMatrix m_drawTransform; | 79 WebKit::WebTransformationMatrix m_drawTransform; |
80 WebKit::WebTransformationMatrix m_screenSpaceTransform; | 80 WebKit::WebTransformationMatrix m_screenSpaceTransform; |
81 WebKit::WebTransformationMatrix m_replicaDrawTransform; | 81 WebKit::WebTransformationMatrix m_replicaDrawTransform; |
82 WebKit::WebTransformationMatrix m_replicaScreenSpaceTransform; | 82 WebKit::WebTransformationMatrix m_replicaScreenSpaceTransform; |
83 bool m_targetSurfaceTransformsAreAnimating; | 83 bool m_targetSurfaceTransformsAreAnimating; |
84 bool m_screenSpaceTransformsAreAnimating; | 84 bool m_screenSpaceTransformsAreAnimating; |
85 | 85 |
86 // Uses the space of the surface's target surface. | 86 // Uses the space of the surface's target surface. |
87 IntRect m_clipRect; | 87 IntRect m_clipRect; |
88 | 88 |
89 LayerList m_layerList; | 89 LayerList m_layerList; |
90 | 90 |
91 // The nearest ancestor target surface that will contain the contents of thi
s surface, and that is going | 91 // The nearest ancestor target surface that will contain the contents of thi
s surface, and that is going |
92 // to move pixels within the surface (such as with a blur). This can point t
o itself. | 92 // to move pixels within the surface (such as with a blur). This can point t
o itself. |
93 RenderSurfaceChromium* m_nearestAncestorThatMovesPixels; | 93 RenderSurface* m_nearestAncestorThatMovesPixels; |
94 | 94 |
95 // For CCLayerIteratorActions | 95 // For LayerIteratorActions |
96 int m_targetRenderSurfaceLayerIndexHistory; | 96 int m_targetRenderSurfaceLayerIndexHistory; |
97 int m_currentLayerIndexHistory; | 97 int m_currentLayerIndexHistory; |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceChromium); | 99 DISALLOW_COPY_AND_ASSIGN(RenderSurface); |
100 }; | 100 }; |
101 | 101 |
102 } | 102 } |
103 #endif | 103 #endif |
OLD | NEW |