| 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 #include <vector> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 11 #include "base/callback.h" | 12 #include "base/callback.h" |
| 12 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 13 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 14 #include "cc/base/list_container.h" | 15 #include "cc/base/list_container.h" |
| 15 #include "cc/base/scoped_ptr_vector.h" | |
| 16 #include "cc/quads/render_pass_id.h" | 16 #include "cc/quads/render_pass_id.h" |
| 17 #include "cc/surfaces/surface_id.h" | 17 #include "cc/surfaces/surface_id.h" |
| 18 #include "skia/ext/refptr.h" | 18 #include "skia/ext/refptr.h" |
| 19 #include "ui/gfx/geometry/rect.h" | 19 #include "ui/gfx/geometry/rect.h" |
| 20 #include "ui/gfx/geometry/rect_f.h" | 20 #include "ui/gfx/geometry/rect_f.h" |
| 21 #include "ui/gfx/transform.h" | 21 #include "ui/gfx/transform.h" |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| 24 namespace trace_event { | 24 namespace trace_event { |
| 25 class TracedValue; | 25 class TracedValue; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 static scoped_ptr<RenderPass> Create(); | 57 static scoped_ptr<RenderPass> Create(); |
| 58 static scoped_ptr<RenderPass> Create(size_t num_layers); | 58 static scoped_ptr<RenderPass> Create(size_t num_layers); |
| 59 static scoped_ptr<RenderPass> Create(size_t shared_quad_state_list_size, | 59 static scoped_ptr<RenderPass> Create(size_t shared_quad_state_list_size, |
| 60 size_t quad_list_size); | 60 size_t quad_list_size); |
| 61 | 61 |
| 62 // A shallow copy of the render pass, which does not include its quads or copy | 62 // A shallow copy of the render pass, which does not include its quads or copy |
| 63 // requests. | 63 // requests. |
| 64 scoped_ptr<RenderPass> Copy(RenderPassId new_id) const; | 64 scoped_ptr<RenderPass> Copy(RenderPassId new_id) const; |
| 65 | 65 |
| 66 // A deep copy of the render passes in the list including the quads. | 66 // A deep copy of the render passes in the list including the quads. |
| 67 static void CopyAll(const ScopedPtrVector<RenderPass>& in, | 67 static void CopyAll(const std::vector<scoped_ptr<RenderPass>>& in, |
| 68 ScopedPtrVector<RenderPass>* out); | 68 std::vector<scoped_ptr<RenderPass>>* out); |
| 69 | 69 |
| 70 void SetNew(RenderPassId id, | 70 void SetNew(RenderPassId id, |
| 71 const gfx::Rect& output_rect, | 71 const gfx::Rect& output_rect, |
| 72 const gfx::Rect& damage_rect, | 72 const gfx::Rect& damage_rect, |
| 73 const gfx::Transform& transform_to_root_target); | 73 const gfx::Transform& transform_to_root_target); |
| 74 | 74 |
| 75 void SetAll(RenderPassId id, | 75 void SetAll(RenderPassId id, |
| 76 const gfx::Rect& output_rect, | 76 const gfx::Rect& output_rect, |
| 77 const gfx::Rect& damage_rect, | 77 const gfx::Rect& damage_rect, |
| 78 const gfx::Transform& transform_to_root_target, | 78 const gfx::Transform& transform_to_root_target, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 105 // render pass' |output_rect|. | 105 // render pass' |output_rect|. |
| 106 gfx::Transform transform_to_root_target; | 106 gfx::Transform transform_to_root_target; |
| 107 | 107 |
| 108 // If false, the pixels in the render pass' texture are all opaque. | 108 // If false, the pixels in the render pass' texture are all opaque. |
| 109 bool has_transparent_background; | 109 bool has_transparent_background; |
| 110 | 110 |
| 111 // If non-empty, the renderer should produce a copy of the render pass' | 111 // If non-empty, the renderer should produce a copy of the render pass' |
| 112 // contents as a bitmap, and give a copy of the bitmap to each callback in | 112 // contents as a bitmap, and give a copy of the bitmap to each callback in |
| 113 // this list. This property should not be serialized between compositors, as | 113 // this list. This property should not be serialized between compositors, as |
| 114 // it only makes sense in the root compositor. | 114 // it only makes sense in the root compositor. |
| 115 ScopedPtrVector<CopyOutputRequest> copy_requests; | 115 std::vector<scoped_ptr<CopyOutputRequest>> copy_requests; |
| 116 | 116 |
| 117 QuadList quad_list; | 117 QuadList quad_list; |
| 118 SharedQuadStateList shared_quad_state_list; | 118 SharedQuadStateList shared_quad_state_list; |
| 119 | 119 |
| 120 // This vector contains the complete set of SurfaceIds referenced by | 120 // This vector contains the complete set of SurfaceIds referenced by |
| 121 // DrawQuads in quad_list. | 121 // DrawQuads in quad_list. |
| 122 std::vector<SurfaceId> referenced_surfaces; | 122 std::vector<SurfaceId> referenced_surfaces; |
| 123 | 123 |
| 124 protected: | 124 protected: |
| 125 explicit RenderPass(size_t num_layers); | 125 explicit RenderPass(size_t num_layers); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 140 namespace BASE_HASH_NAMESPACE { | 140 namespace BASE_HASH_NAMESPACE { |
| 141 template <> | 141 template <> |
| 142 struct hash<cc::RenderPassId> { | 142 struct hash<cc::RenderPassId> { |
| 143 size_t operator()(cc::RenderPassId key) const { | 143 size_t operator()(cc::RenderPassId key) const { |
| 144 return base::HashPair(key.layer_id, static_cast<int>(key.index)); | 144 return base::HashPair(key.layer_id, static_cast<int>(key.index)); |
| 145 } | 145 } |
| 146 }; | 146 }; |
| 147 } // namespace BASE_HASH_NAMESPACE | 147 } // namespace BASE_HASH_NAMESPACE |
| 148 | 148 |
| 149 namespace cc { | 149 namespace cc { |
| 150 typedef ScopedPtrVector<RenderPass> RenderPassList; | 150 typedef std::vector<scoped_ptr<RenderPass>> RenderPassList; |
| 151 typedef base::hash_map<RenderPassId, RenderPass*> RenderPassIdHashMap; | 151 typedef base::hash_map<RenderPassId, RenderPass*> RenderPassIdHashMap; |
| 152 } // namespace cc | 152 } // namespace cc |
| 153 | 153 |
| 154 #endif // CC_QUADS_RENDER_PASS_H_ | 154 #endif // CC_QUADS_RENDER_PASS_H_ |
| OLD | NEW |