| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "ui/gfx/transform.h" | 21 #include "ui/gfx/transform.h" |
| 22 | 22 |
| 23 namespace cc { | 23 namespace cc { |
| 24 | 24 |
| 25 class DrawQuad; | 25 class DrawQuad; |
| 26 class SharedQuadState; | 26 class SharedQuadState; |
| 27 | 27 |
| 28 // A list of DrawQuad objects, sorted internally in front-to-back order. | 28 // A list of DrawQuad objects, sorted internally in front-to-back order. |
| 29 class QuadList : public ScopedPtrVector<DrawQuad> { | 29 class QuadList : public ScopedPtrVector<DrawQuad> { |
| 30 public: | 30 public: |
| 31 typedef reverse_iterator backToFrontIterator; | 31 typedef reverse_iterator BackToFrontIterator; |
| 32 typedef const_reverse_iterator constBackToFrontIterator; | 32 typedef const_reverse_iterator ConstBackToFrontIterator; |
| 33 | 33 |
| 34 inline backToFrontIterator backToFrontBegin() { return rbegin(); } | 34 inline BackToFrontIterator BackToFrontBegin() { return rbegin(); } |
| 35 inline backToFrontIterator backToFrontEnd() { return rend(); } | 35 inline BackToFrontIterator BackToFrontEnd() { return rend(); } |
| 36 inline constBackToFrontIterator backToFrontBegin() const { return rbegin(); } | 36 inline ConstBackToFrontIterator BackToFrontBegin() const { return rbegin(); } |
| 37 inline constBackToFrontIterator backToFrontEnd() const { return rend(); } | 37 inline ConstBackToFrontIterator BackToFrontEnd() const { return rend(); } |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 typedef ScopedPtrVector<SharedQuadState> SharedQuadStateList; | 40 typedef ScopedPtrVector<SharedQuadState> SharedQuadStateList; |
| 41 | 41 |
| 42 class CC_EXPORT RenderPass { | 42 class CC_EXPORT RenderPass { |
| 43 public: | 43 public: |
| 44 struct Id { | 44 struct Id { |
| 45 int layer_id; | 45 int layer_id; |
| 46 int index; | 46 int index; |
| 47 | 47 |
| 48 Id(int layer_id, int index) : layer_id(layer_id), index(index) {} | 48 Id(int layer_id, int index) : layer_id(layer_id), index(index) {} |
| 49 | 49 |
| 50 bool operator==(const Id& other) const { | 50 bool operator==(const Id& other) const { |
| 51 return layer_id == other.layer_id && index == other.index; | 51 return layer_id == other.layer_id && index == other.index; |
| 52 } | 52 } |
| 53 bool operator!=(const Id& other) const { | 53 bool operator!=(const Id& other) const { |
| 54 return !(*this == other); | 54 return !(*this == other); |
| 55 } | 55 } |
| 56 bool operator<(const Id& other) const { | 56 bool operator<(const Id& other) const { |
| 57 return layer_id < other.layer_id || | 57 return layer_id < other.layer_id || |
| 58 (layer_id == other.layer_id && index < other.index); | 58 (layer_id == other.layer_id && index < other.index); |
| 59 } | 59 } |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 ~RenderPass(); | 62 ~RenderPass(); |
| 63 | 63 |
| 64 static scoped_ptr<RenderPass> Create(); | 64 static scoped_ptr<RenderPass> Create(); |
| 65 | 65 |
| 66 // A shallow copy of the render pass, which does not include its quads. | 66 // A shallow copy of the render pass, which does not include its quads. |
| 67 scoped_ptr<RenderPass> Copy(Id newId) const; | 67 scoped_ptr<RenderPass> Copy(Id new_id) const; |
| 68 | 68 |
| 69 void SetNew(Id id, | 69 void SetNew(Id id, |
| 70 gfx::Rect output_rect, | 70 gfx::Rect output_rect, |
| 71 gfx::RectF damage_rect, | 71 gfx::RectF damage_rect, |
| 72 const gfx::Transform& transform_to_root_target); | 72 const gfx::Transform& transform_to_root_target); |
| 73 | 73 |
| 74 void SetAll(Id id, | 74 void SetAll(Id id, |
| 75 gfx::Rect output_rect, | 75 gfx::Rect output_rect, |
| 76 gfx::RectF damage_rect, | 76 gfx::RectF damage_rect, |
| 77 const gfx::Transform& transform_to_root_target, | 77 const gfx::Transform& transform_to_root_target, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 #error define a hash function for your compiler | 126 #error define a hash function for your compiler |
| 127 #endif // COMPILER | 127 #endif // COMPILER |
| 128 } | 128 } |
| 129 | 129 |
| 130 namespace cc { | 130 namespace cc { |
| 131 typedef ScopedPtrVector<RenderPass> RenderPassList; | 131 typedef ScopedPtrVector<RenderPass> RenderPassList; |
| 132 typedef base::hash_map<RenderPass::Id, RenderPass*> RenderPassIdHashMap; | 132 typedef base::hash_map<RenderPass::Id, RenderPass*> RenderPassIdHashMap; |
| 133 } // namespace cc | 133 } // namespace cc |
| 134 | 134 |
| 135 #endif // CC_QUADS_RENDER_PASS_H_ | 135 #endif // CC_QUADS_RENDER_PASS_H_ |
| OLD | NEW |