| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef CCRenderPass_h | 5 #ifndef CCRenderPass_h |
| 6 #define CCRenderPass_h | 6 #define CCRenderPass_h |
| 7 | 7 |
| 8 #include "CCDrawQuad.h" | 8 #include "CCDrawQuad.h" |
| 9 #include "FloatRect.h" | 9 #include "FloatRect.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "cc/hash_pair.h" | 11 #include "cc/hash_pair.h" |
| 12 #include "cc/scoped_ptr_hash_map.h" | 12 #include "cc/scoped_ptr_hash_map.h" |
| 13 #include "cc/scoped_ptr_vector.h" | 13 #include "cc/scoped_ptr_vector.h" |
| 14 #include "cc/shared_quad_state.h" | 14 #include "cc/shared_quad_state.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/gfx/rect_f.h" |
| 16 #include <public/WebFilterOperations.h> | 17 #include <public/WebFilterOperations.h> |
| 17 #include <public/WebTransformationMatrix.h> | 18 #include <public/WebTransformationMatrix.h> |
| 18 #include <vector> | 19 #include <vector> |
| 19 | 20 |
| 20 namespace cc { | 21 namespace cc { |
| 21 | 22 |
| 22 class CCLayerImpl; | 23 class CCLayerImpl; |
| 23 template<typename LayerType, typename SurfaceType> | 24 template<typename LayerType, typename SurfaceType> |
| 24 class CCOcclusionTrackerBase; | 25 class CCOcclusionTrackerBase; |
| 25 class CCRenderSurface; | 26 class CCRenderSurface; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 54 : layerId(layerId) | 55 : layerId(layerId) |
| 55 , index(index) | 56 , index(index) |
| 56 { | 57 { |
| 57 } | 58 } |
| 58 | 59 |
| 59 bool operator==(const Id& other) const { return layerId == other.layerId
&& index == other.index; } | 60 bool operator==(const Id& other) const { return layerId == other.layerId
&& index == other.index; } |
| 60 bool operator!=(const Id& other) const { return !(*this == other); } | 61 bool operator!=(const Id& other) const { return !(*this == other); } |
| 61 bool operator<(const Id& other) const { return layerId < other.layerId |
| (layerId == other.layerId && index < other.index); } | 62 bool operator<(const Id& other) const { return layerId < other.layerId |
| (layerId == other.layerId && index < other.index); } |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 static scoped_ptr<CCRenderPass> create(Id, IntRect outputRect, const WebKit:
:WebTransformationMatrix& transformToRootTarget); | 65 static scoped_ptr<CCRenderPass> create(Id, gfx::Rect outputRect, const WebKi
t::WebTransformationMatrix& transformToRootTarget); |
| 65 | 66 |
| 66 // A shallow copy of the render pass, which does not include its quads. | 67 // A shallow copy of the render pass, which does not include its quads. |
| 67 scoped_ptr<CCRenderPass> copy(Id newId) const; | 68 scoped_ptr<CCRenderPass> copy(Id newId) const; |
| 68 | 69 |
| 69 void appendQuadsForLayer(CCLayerImpl*, CCOcclusionTrackerImpl*, CCAppendQuad
sData&); | 70 void appendQuadsForLayer(CCLayerImpl*, CCOcclusionTrackerImpl*, CCAppendQuad
sData&); |
| 70 void appendQuadsForRenderSurfaceLayer(CCLayerImpl*, const CCRenderPass* cont
ributingRenderPass, CCOcclusionTrackerImpl*, CCAppendQuadsData&); | 71 void appendQuadsForRenderSurfaceLayer(CCLayerImpl*, const CCRenderPass* cont
ributingRenderPass, CCOcclusionTrackerImpl*, CCAppendQuadsData&); |
| 71 void appendQuadsToFillScreen(CCLayerImpl* rootLayer, SkColor screenBackgroun
dColor, const CCOcclusionTrackerImpl&); | 72 void appendQuadsToFillScreen(CCLayerImpl* rootLayer, SkColor screenBackgroun
dColor, const CCOcclusionTrackerImpl&); |
| 72 | 73 |
| 73 const CCQuadList& quadList() const { return m_quadList; } | 74 const CCQuadList& quadList() const { return m_quadList; } |
| 74 | 75 |
| 75 Id id() const { return m_id; } | 76 Id id() const { return m_id; } |
| 76 | 77 |
| 77 // FIXME: Modify this transform when merging the RenderPass into a parent co
mpositor. | 78 // FIXME: Modify this transform when merging the RenderPass into a parent co
mpositor. |
| 78 // Transforms from quad's original content space to the root target's conten
t space. | 79 // Transforms from quad's original content space to the root target's conten
t space. |
| 79 const WebKit::WebTransformationMatrix& transformToRootTarget() const { retur
n m_transformToRootTarget; } | 80 const WebKit::WebTransformationMatrix& transformToRootTarget() const { retur
n m_transformToRootTarget; } |
| 80 | 81 |
| 81 // This denotes the bounds in physical pixels of the output generated by thi
s RenderPass. | 82 // This denotes the bounds in physical pixels of the output generated by thi
s RenderPass. |
| 82 const IntRect& outputRect() const { return m_outputRect; } | 83 const gfx::Rect& outputRect() const { return m_outputRect; } |
| 83 | 84 |
| 84 FloatRect damageRect() const { return m_damageRect; } | 85 gfx::RectF damageRect() const { return m_damageRect; } |
| 85 void setDamageRect(FloatRect rect) { m_damageRect = rect; } | 86 void setDamageRect(gfx::RectF rect) { m_damageRect = rect; } |
| 86 | 87 |
| 87 const WebKit::WebFilterOperations& filters() const { return m_filters; } | 88 const WebKit::WebFilterOperations& filters() const { return m_filters; } |
| 88 void setFilters(const WebKit::WebFilterOperations& filters) { m_filters = fi
lters; } | 89 void setFilters(const WebKit::WebFilterOperations& filters) { m_filters = fi
lters; } |
| 89 | 90 |
| 90 const WebKit::WebFilterOperations& backgroundFilters() const { return m_back
groundFilters; } | 91 const WebKit::WebFilterOperations& backgroundFilters() const { return m_back
groundFilters; } |
| 91 void setBackgroundFilters(const WebKit::WebFilterOperations& filters) { m_ba
ckgroundFilters = filters; } | 92 void setBackgroundFilters(const WebKit::WebFilterOperations& filters) { m_ba
ckgroundFilters = filters; } |
| 92 | 93 |
| 93 bool hasTransparentBackground() const { return m_hasTransparentBackground; } | 94 bool hasTransparentBackground() const { return m_hasTransparentBackground; } |
| 94 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } | 95 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } |
| 95 | 96 |
| 96 bool hasOcclusionFromOutsideTargetSurface() const { return m_hasOcclusionFro
mOutsideTargetSurface; } | 97 bool hasOcclusionFromOutsideTargetSurface() const { return m_hasOcclusionFro
mOutsideTargetSurface; } |
| 97 void setHasOcclusionFromOutsideTargetSurface(bool hasOcclusionFromOutsideTar
getSurface) { m_hasOcclusionFromOutsideTargetSurface = hasOcclusionFromOutsideTa
rgetSurface; } | 98 void setHasOcclusionFromOutsideTargetSurface(bool hasOcclusionFromOutsideTar
getSurface) { m_hasOcclusionFromOutsideTargetSurface = hasOcclusionFromOutsideTa
rgetSurface; } |
| 98 protected: | 99 protected: |
| 99 CCRenderPass(Id, IntRect outputRect, const WebKit::WebTransformationMatrix&
transformToRootTarget); | 100 CCRenderPass(Id, gfx::Rect outputRect, const WebKit::WebTransformationMatrix
& transformToRootTarget); |
| 100 | 101 |
| 101 Id m_id; | 102 Id m_id; |
| 102 CCQuadList m_quadList; | 103 CCQuadList m_quadList; |
| 103 CCSharedQuadStateList m_sharedQuadStateList; | 104 CCSharedQuadStateList m_sharedQuadStateList; |
| 104 WebKit::WebTransformationMatrix m_transformToRootTarget; | 105 WebKit::WebTransformationMatrix m_transformToRootTarget; |
| 105 IntRect m_outputRect; | 106 gfx::Rect m_outputRect; |
| 106 FloatRect m_damageRect; | 107 gfx::RectF m_damageRect; |
| 107 bool m_hasTransparentBackground; | 108 bool m_hasTransparentBackground; |
| 108 bool m_hasOcclusionFromOutsideTargetSurface; | 109 bool m_hasOcclusionFromOutsideTargetSurface; |
| 109 WebKit::WebFilterOperations m_filters; | 110 WebKit::WebFilterOperations m_filters; |
| 110 WebKit::WebFilterOperations m_backgroundFilters; | 111 WebKit::WebFilterOperations m_backgroundFilters; |
| 111 | 112 |
| 112 DISALLOW_COPY_AND_ASSIGN(CCRenderPass); | 113 DISALLOW_COPY_AND_ASSIGN(CCRenderPass); |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 } // namespace cc | 116 } // namespace cc |
| 116 | 117 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 131 #error define a hash function for your compiler | 132 #error define a hash function for your compiler |
| 132 #endif // COMPILER | 133 #endif // COMPILER |
| 133 } | 134 } |
| 134 | 135 |
| 135 namespace cc { | 136 namespace cc { |
| 136 typedef std::vector<CCRenderPass*> CCRenderPassList; | 137 typedef std::vector<CCRenderPass*> CCRenderPassList; |
| 137 typedef ScopedPtrHashMap<CCRenderPass::Id, CCRenderPass> CCRenderPassIdHashMap; | 138 typedef ScopedPtrHashMap<CCRenderPass::Id, CCRenderPass> CCRenderPassIdHashMap; |
| 138 } // namespace cc | 139 } // namespace cc |
| 139 | 140 |
| 140 #endif | 141 #endif |
| OLD | NEW |