| 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 "base/basictypes.h" |
| 9 #include "cc/hash_pair.h" |
| 10 #include "cc/scoped_ptr_hash_map.h" |
| 11 #include "cc/scoped_ptr_vector.h" |
| 8 #include "CCDrawQuad.h" | 12 #include "CCDrawQuad.h" |
| 9 #include "CCOcclusionTracker.h" | 13 #include "CCOcclusionTracker.h" |
| 10 #include "CCSharedQuadState.h" | 14 #include "CCSharedQuadState.h" |
| 11 #include "FloatRect.h" | 15 #include "FloatRect.h" |
| 12 #include "SkColor.h" | 16 #include "SkColor.h" |
| 13 #include "cc/hash_pair.h" | |
| 14 #include "cc/scoped_ptr_hash_map.h" | |
| 15 #include "cc/scoped_ptr_vector.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 class CCRenderSurface; | 24 class CCRenderSurface; |
| 24 | 25 |
| 25 struct CCAppendQuadsData; | 26 struct CCAppendQuadsData; |
| 26 | 27 |
| 27 // A list of CCDrawQuad objects, sorted internally in front-to-back order. | 28 // A list of CCDrawQuad objects, sorted internally in front-to-back order. |
| 28 class CCQuadList : public ScopedPtrVector<CCDrawQuad> { | 29 class CCQuadList : public ScopedPtrVector<CCDrawQuad> { |
| 29 public: | 30 public: |
| 30 typedef reverse_iterator backToFrontIterator; | 31 typedef reverse_iterator backToFrontIterator; |
| 31 typedef const_reverse_iterator constBackToFrontIterator; | 32 typedef const_reverse_iterator constBackToFrontIterator; |
| 32 | 33 |
| 33 inline backToFrontIterator backToFrontBegin() { return rbegin(); } | 34 inline backToFrontIterator backToFrontBegin() { return rbegin(); } |
| 34 inline backToFrontIterator backToFrontEnd() { return rend(); } | 35 inline backToFrontIterator backToFrontEnd() { return rend(); } |
| 35 inline constBackToFrontIterator backToFrontBegin() const { return rbegin();
} | 36 inline constBackToFrontIterator backToFrontBegin() const { return rbegin();
} |
| 36 inline constBackToFrontIterator backToFrontEnd() const { return rend(); } | 37 inline constBackToFrontIterator backToFrontEnd() const { return rend(); } |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 typedef ScopedPtrVector<CCSharedQuadState> CCSharedQuadStateList; | 40 typedef ScopedPtrVector<CCSharedQuadState> CCSharedQuadStateList; |
| 40 | 41 |
| 41 class CCRenderPass { | 42 class CCRenderPass { |
| 42 WTF_MAKE_NONCOPYABLE(CCRenderPass); | |
| 43 public: | 43 public: |
| 44 ~CCRenderPass(); | 44 ~CCRenderPass(); |
| 45 | 45 |
| 46 struct Id { | 46 struct Id { |
| 47 int layerId; | 47 int layerId; |
| 48 int index; | 48 int index; |
| 49 | 49 |
| 50 Id(int layerId, int index) | 50 Id(int layerId, int index) |
| 51 : layerId(layerId) | 51 : layerId(layerId) |
| 52 , index(index) | 52 , index(index) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 IntRect m_outputRect; |
| 103 FloatRect m_damageRect; | 103 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 |
| 109 DISALLOW_COPY_AND_ASSIGN(CCRenderPass); |
| 108 }; | 110 }; |
| 109 | 111 |
| 110 } // namespace cc | 112 } // namespace cc |
| 111 | 113 |
| 112 namespace BASE_HASH_NAMESPACE { | 114 namespace BASE_HASH_NAMESPACE { |
| 113 #if defined(COMPILER_MSVC) | 115 #if defined(COMPILER_MSVC) |
| 114 template<> | 116 template<> |
| 115 inline size_t hash_value<cc::CCRenderPass::Id>(const cc::CCRenderPass::Id& key)
{ | 117 inline size_t hash_value<cc::CCRenderPass::Id>(const cc::CCRenderPass::Id& key)
{ |
| 116 return hash_value<std::pair<int, int> >(std::pair<int, int>(key.layerId, key
.index)); | 118 return hash_value<std::pair<int, int> >(std::pair<int, int>(key.layerId, key
.index)); |
| 117 } | 119 } |
| 118 #elif defined(COMPILER_GCC) | 120 #elif defined(COMPILER_GCC) |
| 119 template<> | 121 template<> |
| 120 struct hash<cc::CCRenderPass::Id> { | 122 struct hash<cc::CCRenderPass::Id> { |
| 121 size_t operator()(cc::CCRenderPass::Id key) const { | 123 size_t operator()(cc::CCRenderPass::Id key) const { |
| 122 return hash<std::pair<int, int> >()(std::pair<int, int>(key.layerId, key
.index)); | 124 return hash<std::pair<int, int> >()(std::pair<int, int>(key.layerId, key
.index)); |
| 123 } | 125 } |
| 124 }; | 126 }; |
| 125 #else | 127 #else |
| 126 #error define a hash function for your compiler | 128 #error define a hash function for your compiler |
| 127 #endif // COMPILER | 129 #endif // COMPILER |
| 128 } | 130 } |
| 129 | 131 |
| 130 namespace cc { | 132 namespace cc { |
| 131 typedef std::vector<CCRenderPass*> CCRenderPassList; | 133 typedef std::vector<CCRenderPass*> CCRenderPassList; |
| 132 typedef ScopedPtrHashMap<CCRenderPass::Id, CCRenderPass> CCRenderPassIdHashMap; | 134 typedef ScopedPtrHashMap<CCRenderPass::Id, CCRenderPass> CCRenderPassIdHashMap; |
| 133 } // namespace cc | 135 } // namespace cc |
| 134 | 136 |
| 135 #endif | 137 #endif |
| OLD | NEW |