OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 *width = DebugColors::MaskingLayerBorderWidth(layer_tree_impl()); | 282 *width = DebugColors::MaskingLayerBorderWidth(layer_tree_impl()); |
283 return; | 283 return; |
284 } | 284 } |
285 | 285 |
286 *color = DebugColors::ContainerLayerBorderColor(); | 286 *color = DebugColors::ContainerLayerBorderColor(); |
287 *width = DebugColors::ContainerLayerBorderWidth(layer_tree_impl()); | 287 *width = DebugColors::ContainerLayerBorderWidth(layer_tree_impl()); |
288 } | 288 } |
289 | 289 |
290 void LayerImpl::AppendDebugBorderQuad( | 290 void LayerImpl::AppendDebugBorderQuad( |
291 QuadSink* quad_sink, | 291 QuadSink* quad_sink, |
| 292 const gfx::Size& content_bounds, |
292 const SharedQuadState* shared_quad_state, | 293 const SharedQuadState* shared_quad_state, |
293 AppendQuadsData* append_quads_data) const { | 294 AppendQuadsData* append_quads_data) const { |
294 SkColor color; | 295 SkColor color; |
295 float width; | 296 float width; |
296 GetDebugBorderProperties(&color, &width); | 297 GetDebugBorderProperties(&color, &width); |
297 AppendDebugBorderQuad( | 298 AppendDebugBorderQuad(quad_sink, |
298 quad_sink, shared_quad_state, append_quads_data, color, width); | 299 content_bounds, |
| 300 shared_quad_state, |
| 301 append_quads_data, |
| 302 color, |
| 303 width); |
299 } | 304 } |
300 | 305 |
301 void LayerImpl::AppendDebugBorderQuad(QuadSink* quad_sink, | 306 void LayerImpl::AppendDebugBorderQuad(QuadSink* quad_sink, |
| 307 const gfx::Size& content_bounds, |
302 const SharedQuadState* shared_quad_state, | 308 const SharedQuadState* shared_quad_state, |
303 AppendQuadsData* append_quads_data, | 309 AppendQuadsData* append_quads_data, |
304 SkColor color, | 310 SkColor color, |
305 float width) const { | 311 float width) const { |
306 if (!ShowDebugBorders()) | 312 if (!ShowDebugBorders()) |
307 return; | 313 return; |
308 | 314 |
309 gfx::Rect quad_rect(content_bounds()); | 315 gfx::Rect quad_rect(content_bounds); |
310 gfx::Rect visible_quad_rect(quad_rect); | 316 gfx::Rect visible_quad_rect(quad_rect); |
311 scoped_ptr<DebugBorderDrawQuad> debug_border_quad = | 317 scoped_ptr<DebugBorderDrawQuad> debug_border_quad = |
312 DebugBorderDrawQuad::Create(); | 318 DebugBorderDrawQuad::Create(); |
313 debug_border_quad->SetNew( | 319 debug_border_quad->SetNew( |
314 shared_quad_state, quad_rect, visible_quad_rect, color, width); | 320 shared_quad_state, quad_rect, visible_quad_rect, color, width); |
315 quad_sink->Append(debug_border_quad.PassAs<DrawQuad>()); | 321 quad_sink->Append(debug_border_quad.PassAs<DrawQuad>()); |
316 } | 322 } |
317 | 323 |
318 bool LayerImpl::HasDelegatedContent() const { | 324 bool LayerImpl::HasDelegatedContent() const { |
319 return false; | 325 return false; |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1487 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
1482 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1488 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1483 AsValueInto(state.get()); | 1489 AsValueInto(state.get()); |
1484 return state.PassAs<base::Value>(); | 1490 return state.PassAs<base::Value>(); |
1485 } | 1491 } |
1486 | 1492 |
1487 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1493 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
1488 benchmark->RunOnLayer(this); | 1494 benchmark->RunOnLayer(this); |
1489 } | 1495 } |
1490 } // namespace cc | 1496 } // namespace cc |
OLD | NEW |