| 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 #include "cc/quads/render_pass.h" | 5 #include "cc/quads/render_pass.h" |
| 6 | 6 |
| 7 #include "base/debug/traced_value.h" |
| 7 #include "base/values.h" | 8 #include "base/values.h" |
| 8 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 9 #include "cc/debug/traced_value.h" | |
| 10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
| 11 #include "cc/quads/draw_quad.h" | 11 #include "cc/quads/draw_quad.h" |
| 12 #include "cc/quads/render_pass_draw_quad.h" | 12 #include "cc/quads/render_pass_draw_quad.h" |
| 13 #include "cc/quads/shared_quad_state.h" | 13 #include "cc/quads/shared_quad_state.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 const size_t kDefaultNumSharedQuadStatesToReserve = 32; | 16 const size_t kDefaultNumSharedQuadStatesToReserve = 32; |
| 17 const size_t kDefaultNumQuadsToReserve = 128; | 17 const size_t kDefaultNumQuadsToReserve = 128; |
| 18 } | 18 } |
| 19 | 19 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 for (size_t i = 0; i < shared_quad_state_list.size(); ++i) { | 156 for (size_t i = 0; i < shared_quad_state_list.size(); ++i) { |
| 157 shared_states_value->Append(shared_quad_state_list[i]->AsValue().release()); | 157 shared_states_value->Append(shared_quad_state_list[i]->AsValue().release()); |
| 158 } | 158 } |
| 159 value->Set("shared_quad_state_list", shared_states_value.release()); | 159 value->Set("shared_quad_state_list", shared_states_value.release()); |
| 160 scoped_ptr<base::ListValue> quad_list_value(new base::ListValue()); | 160 scoped_ptr<base::ListValue> quad_list_value(new base::ListValue()); |
| 161 for (size_t i = 0; i < quad_list.size(); ++i) { | 161 for (size_t i = 0; i < quad_list.size(); ++i) { |
| 162 quad_list_value->Append(quad_list[i]->AsValue().release()); | 162 quad_list_value->Append(quad_list[i]->AsValue().release()); |
| 163 } | 163 } |
| 164 value->Set("quad_list", quad_list_value.release()); | 164 value->Set("quad_list", quad_list_value.release()); |
| 165 | 165 |
| 166 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( | 166 base::debug::TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
| 167 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), | 167 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), |
| 168 value.get(), "cc::RenderPass", id.AsTracingId()); | 168 value.get(), |
| 169 "cc::RenderPass", |
| 170 id.AsTracingId()); |
| 169 return value.PassAs<base::Value>(); | 171 return value.PassAs<base::Value>(); |
| 170 } | 172 } |
| 171 | 173 |
| 172 SharedQuadState* RenderPass::CreateAndAppendSharedQuadState() { | 174 SharedQuadState* RenderPass::CreateAndAppendSharedQuadState() { |
| 173 shared_quad_state_list.push_back(SharedQuadState::Create()); | 175 shared_quad_state_list.push_back(SharedQuadState::Create()); |
| 174 return shared_quad_state_list.back(); | 176 return shared_quad_state_list.back(); |
| 175 } | 177 } |
| 176 | 178 |
| 177 } // namespace cc | 179 } // namespace cc |
| OLD | NEW |