| 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 "CCOcclusionTracker.h" | 9 #include "CCOcclusionTracker.h" |
| 10 #include "CCSharedQuadState.h" | 10 #include "CCSharedQuadState.h" |
| 11 #include "FloatRect.h" | |
| 12 #include "SkColor.h" | 11 #include "SkColor.h" |
| 12 #include "cc/math/float_rect.h" |
| 13 #include "cc/own_ptr_vector.h" | 13 #include "cc/own_ptr_vector.h" |
| 14 #include <public/WebFilterOperations.h> | 14 #include <public/WebFilterOperations.h> |
| 15 #include <public/WebTransformationMatrix.h> | 15 #include <public/WebTransformationMatrix.h> |
| 16 #include <wtf/HashMap.h> | 16 #include <wtf/HashMap.h> |
| 17 #include <wtf/PassOwnPtr.h> | 17 #include <wtf/PassOwnPtr.h> |
| 18 #include <wtf/Vector.h> | 18 #include <wtf/Vector.h> |
| 19 | 19 |
| 20 namespace cc { | 20 namespace cc { |
| 21 | 21 |
| 22 class CCLayerImpl; | 22 class CCLayerImpl; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 51 : layerId(layerId) | 51 : layerId(layerId) |
| 52 , index(index) | 52 , index(index) |
| 53 { | 53 { |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool operator==(const Id& other) const { return layerId == other.layerId
&& index == other.index; } | 56 bool operator==(const Id& other) const { return layerId == other.layerId
&& index == other.index; } |
| 57 bool operator!=(const Id& other) const { return !(*this == other); } | 57 bool operator!=(const Id& other) const { return !(*this == other); } |
| 58 bool operator<(const Id& other) const { return layerId < other.layerId |
| (layerId == other.layerId && index < other.index); } | 58 bool operator<(const Id& other) const { return layerId < other.layerId |
| (layerId == other.layerId && index < other.index); } |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 static PassOwnPtr<CCRenderPass> create(Id, IntRect outputRect, const WebKit:
:WebTransformationMatrix& transformToRootTarget); | 61 static PassOwnPtr<CCRenderPass> create(Id, ccmath::IntRect outputRect, const
WebKit::WebTransformationMatrix& transformToRootTarget); |
| 62 | 62 |
| 63 // A shallow copy of the render pass, which does not include its quads. | 63 // A shallow copy of the render pass, which does not include its quads. |
| 64 PassOwnPtr<CCRenderPass> copy(Id newId) const; | 64 PassOwnPtr<CCRenderPass> copy(Id newId) const; |
| 65 | 65 |
| 66 void appendQuadsForLayer(CCLayerImpl*, CCOcclusionTrackerImpl*, CCAppendQuad
sData&); | 66 void appendQuadsForLayer(CCLayerImpl*, CCOcclusionTrackerImpl*, CCAppendQuad
sData&); |
| 67 void appendQuadsForRenderSurfaceLayer(CCLayerImpl*, const CCRenderPass* cont
ributingRenderPass, CCOcclusionTrackerImpl*, CCAppendQuadsData&); | 67 void appendQuadsForRenderSurfaceLayer(CCLayerImpl*, const CCRenderPass* cont
ributingRenderPass, CCOcclusionTrackerImpl*, CCAppendQuadsData&); |
| 68 void appendQuadsToFillScreen(CCLayerImpl* rootLayer, SkColor screenBackgroun
dColor, const CCOcclusionTrackerImpl&); | 68 void appendQuadsToFillScreen(CCLayerImpl* rootLayer, SkColor screenBackgroun
dColor, const CCOcclusionTrackerImpl&); |
| 69 | 69 |
| 70 const CCQuadList& quadList() const { return m_quadList; } | 70 const CCQuadList& quadList() const { return m_quadList; } |
| 71 | 71 |
| 72 Id id() const { return m_id; } | 72 Id id() const { return m_id; } |
| 73 | 73 |
| 74 // FIXME: Modify this transform when merging the RenderPass into a parent co
mpositor. | 74 // FIXME: Modify this transform when merging the RenderPass into a parent co
mpositor. |
| 75 // Transforms from quad's original content space to the root target's conten
t space. | 75 // Transforms from quad's original content space to the root target's conten
t space. |
| 76 const WebKit::WebTransformationMatrix& transformToRootTarget() const { retur
n m_transformToRootTarget; } | 76 const WebKit::WebTransformationMatrix& transformToRootTarget() const { retur
n m_transformToRootTarget; } |
| 77 | 77 |
| 78 // This denotes the bounds in physical pixels of the output generated by thi
s RenderPass. | 78 // This denotes the bounds in physical pixels of the output generated by thi
s RenderPass. |
| 79 const IntRect& outputRect() const { return m_outputRect; } | 79 const ccmath::IntRect& outputRect() const { return m_outputRect; } |
| 80 | 80 |
| 81 FloatRect damageRect() const { return m_damageRect; } | 81 ccmath::FloatRect damageRect() const { return m_damageRect; } |
| 82 void setDamageRect(FloatRect rect) { m_damageRect = rect; } | 82 void setDamageRect(ccmath::FloatRect rect) { m_damageRect = rect; } |
| 83 | 83 |
| 84 const WebKit::WebFilterOperations& filters() const { return m_filters; } | 84 const WebKit::WebFilterOperations& filters() const { return m_filters; } |
| 85 void setFilters(const WebKit::WebFilterOperations& filters) { m_filters = fi
lters; } | 85 void setFilters(const WebKit::WebFilterOperations& filters) { m_filters = fi
lters; } |
| 86 | 86 |
| 87 const WebKit::WebFilterOperations& backgroundFilters() const { return m_back
groundFilters; } | 87 const WebKit::WebFilterOperations& backgroundFilters() const { return m_back
groundFilters; } |
| 88 void setBackgroundFilters(const WebKit::WebFilterOperations& filters) { m_ba
ckgroundFilters = filters; } | 88 void setBackgroundFilters(const WebKit::WebFilterOperations& filters) { m_ba
ckgroundFilters = filters; } |
| 89 | 89 |
| 90 bool hasTransparentBackground() const { return m_hasTransparentBackground; } | 90 bool hasTransparentBackground() const { return m_hasTransparentBackground; } |
| 91 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } | 91 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } |
| 92 | 92 |
| 93 bool hasOcclusionFromOutsideTargetSurface() const { return m_hasOcclusionFro
mOutsideTargetSurface; } | 93 bool hasOcclusionFromOutsideTargetSurface() const { return m_hasOcclusionFro
mOutsideTargetSurface; } |
| 94 void setHasOcclusionFromOutsideTargetSurface(bool hasOcclusionFromOutsideTar
getSurface) { m_hasOcclusionFromOutsideTargetSurface = hasOcclusionFromOutsideTa
rgetSurface; } | 94 void setHasOcclusionFromOutsideTargetSurface(bool hasOcclusionFromOutsideTar
getSurface) { m_hasOcclusionFromOutsideTargetSurface = hasOcclusionFromOutsideTa
rgetSurface; } |
| 95 protected: | 95 protected: |
| 96 CCRenderPass(Id, IntRect outputRect, const WebKit::WebTransformationMatrix&
transformToRootTarget); | 96 CCRenderPass(Id, ccmath::IntRect outputRect, const WebKit::WebTransformation
Matrix& transformToRootTarget); |
| 97 | 97 |
| 98 Id m_id; | 98 Id m_id; |
| 99 CCQuadList m_quadList; | 99 CCQuadList m_quadList; |
| 100 CCSharedQuadStateList m_sharedQuadStateList; | 100 CCSharedQuadStateList m_sharedQuadStateList; |
| 101 WebKit::WebTransformationMatrix m_transformToRootTarget; | 101 WebKit::WebTransformationMatrix m_transformToRootTarget; |
| 102 IntRect m_outputRect; | 102 ccmath::IntRect m_outputRect; |
| 103 FloatRect m_damageRect; | 103 ccmath::FloatRect m_damageRect; |
| 104 bool m_hasTransparentBackground; | 104 bool m_hasTransparentBackground; |
| 105 bool m_hasOcclusionFromOutsideTargetSurface; | 105 bool m_hasOcclusionFromOutsideTargetSurface; |
| 106 WebKit::WebFilterOperations m_filters; | 106 WebKit::WebFilterOperations m_filters; |
| 107 WebKit::WebFilterOperations m_backgroundFilters; | 107 WebKit::WebFilterOperations m_backgroundFilters; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace cc | 110 } // namespace cc |
| 111 | 111 |
| 112 namespace WTF { | 112 namespace WTF { |
| 113 template<> struct HashTraits<cc::CCRenderPass::Id> : GenericHashTraits<cc::CCRen
derPass::Id> { | 113 template<> struct HashTraits<cc::CCRenderPass::Id> : GenericHashTraits<cc::CCRen
derPass::Id> { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 126 typedef IntHash<cc::CCRenderPass::Id> Hash; | 126 typedef IntHash<cc::CCRenderPass::Id> Hash; |
| 127 }; | 127 }; |
| 128 } // namespace WTF | 128 } // namespace WTF |
| 129 | 129 |
| 130 namespace cc { | 130 namespace cc { |
| 131 typedef Vector<CCRenderPass*> CCRenderPassList; | 131 typedef Vector<CCRenderPass*> CCRenderPassList; |
| 132 typedef HashMap<CCRenderPass::Id, OwnPtr<CCRenderPass> > CCRenderPassIdHashMap; | 132 typedef HashMap<CCRenderPass::Id, OwnPtr<CCRenderPass> > CCRenderPassIdHashMap; |
| 133 } // namespace cc | 133 } // namespace cc |
| 134 | 134 |
| 135 #endif | 135 #endif |
| OLD | NEW |