Chromium Code Reviews| 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 CC_QUADS_RENDER_PASS_H_ | 5 #ifndef CC_QUADS_RENDER_PASS_H_ |
| 6 #define CC_QUADS_RENDER_PASS_H_ | 6 #define CC_QUADS_RENDER_PASS_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 | 40 |
| 41 typedef QuadList::ReverseIterator BackToFrontIterator; | 41 typedef QuadList::ReverseIterator BackToFrontIterator; |
| 42 typedef QuadList::ConstReverseIterator ConstBackToFrontIterator; | 42 typedef QuadList::ConstReverseIterator ConstBackToFrontIterator; |
| 43 | 43 |
| 44 inline BackToFrontIterator BackToFrontBegin() { return rbegin(); } | 44 inline BackToFrontIterator BackToFrontBegin() { return rbegin(); } |
| 45 inline BackToFrontIterator BackToFrontEnd() { return rend(); } | 45 inline BackToFrontIterator BackToFrontEnd() { return rend(); } |
| 46 inline ConstBackToFrontIterator BackToFrontBegin() const { return rbegin(); } | 46 inline ConstBackToFrontIterator BackToFrontBegin() const { return rbegin(); } |
| 47 inline ConstBackToFrontIterator BackToFrontEnd() const { return rend(); } | 47 inline ConstBackToFrontIterator BackToFrontEnd() const { return rend(); } |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 typedef ScopedPtrVector<SharedQuadState> SharedQuadStateList; | 50 typedef ListContainer<SharedQuadState> SharedQuadStateList; |
| 51 | 51 |
| 52 class CC_EXPORT RenderPass { | 52 class CC_EXPORT RenderPass { |
| 53 public: | 53 public: |
| 54 ~RenderPass(); | 54 ~RenderPass(); |
| 55 | 55 |
| 56 static scoped_ptr<RenderPass> Create(); | 56 static scoped_ptr<RenderPass> Create(); |
| 57 static scoped_ptr<RenderPass> Create(size_t num_layers); | 57 static scoped_ptr<RenderPass> Create(size_t num_layers); |
| 58 static scoped_ptr<RenderPass> Create(size_t shared_quad_state_list_size, | |
| 59 size_t quad_list_size); | |
| 58 | 60 |
| 59 // A shallow copy of the render pass, which does not include its quads or copy | 61 // A shallow copy of the render pass, which does not include its quads or copy |
| 60 // requests. | 62 // requests. |
| 61 scoped_ptr<RenderPass> Copy(RenderPassId new_id) const; | 63 scoped_ptr<RenderPass> Copy(RenderPassId new_id) const; |
| 62 | 64 |
| 63 // A deep copy of the render passes in the list including the quads. | 65 // A deep copy of the render passes in the list including the quads. |
| 64 static void CopyAll(const ScopedPtrVector<RenderPass>& in, | 66 static void CopyAll(const ScopedPtrVector<RenderPass>& in, |
| 65 ScopedPtrVector<RenderPass>* out); | 67 ScopedPtrVector<RenderPass>* out); |
| 66 | 68 |
| 67 void SetNew(RenderPassId id, | 69 void SetNew(RenderPassId id, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 // this list. This property should not be serialized between compositors, as | 112 // this list. This property should not be serialized between compositors, as |
| 111 // it only makes sense in the root compositor. | 113 // it only makes sense in the root compositor. |
| 112 ScopedPtrVector<CopyOutputRequest> copy_requests; | 114 ScopedPtrVector<CopyOutputRequest> copy_requests; |
| 113 | 115 |
| 114 QuadList quad_list; | 116 QuadList quad_list; |
| 115 SharedQuadStateList shared_quad_state_list; | 117 SharedQuadStateList shared_quad_state_list; |
| 116 | 118 |
| 117 protected: | 119 protected: |
| 118 explicit RenderPass(size_t num_layers); | 120 explicit RenderPass(size_t num_layers); |
| 119 RenderPass(); | 121 RenderPass(); |
| 122 RenderPass(size_t shared_quad_state_list, size_t quad_list_size); | |
|
danakj
2014/09/26 20:40:55
sqs_list_size <- size missing
weiliangc
2014/10/01 23:02:00
Done.
| |
| 120 | 123 |
| 121 private: | 124 private: |
| 122 template <typename DrawQuadType> | 125 template <typename DrawQuadType> |
| 123 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { | 126 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { |
| 124 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); | 127 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); |
| 125 } | 128 } |
| 126 | 129 |
| 127 DISALLOW_COPY_AND_ASSIGN(RenderPass); | 130 DISALLOW_COPY_AND_ASSIGN(RenderPass); |
| 128 }; | 131 }; |
| 129 | 132 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 145 #error define a hash function for your compiler | 148 #error define a hash function for your compiler |
| 146 #endif // COMPILER | 149 #endif // COMPILER |
| 147 } // namespace BASE_HASH_NAMESPACE | 150 } // namespace BASE_HASH_NAMESPACE |
| 148 | 151 |
| 149 namespace cc { | 152 namespace cc { |
| 150 typedef ScopedPtrVector<RenderPass> RenderPassList; | 153 typedef ScopedPtrVector<RenderPass> RenderPassList; |
| 151 typedef base::hash_map<RenderPassId, RenderPass*> RenderPassIdHashMap; | 154 typedef base::hash_map<RenderPassId, RenderPass*> RenderPassIdHashMap; |
| 152 } // namespace cc | 155 } // namespace cc |
| 153 | 156 |
| 154 #endif // CC_QUADS_RENDER_PASS_H_ | 157 #endif // CC_QUADS_RENDER_PASS_H_ |
| OLD | NEW |