Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: cc/layers/layer_impl.cc

Issue 341023003: cc: Pass scaled bounds to debug border quads for drawing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 *width = DebugColors::ContainerLayerBorderWidth(layer_tree_impl()); 286 *width = DebugColors::ContainerLayerBorderWidth(layer_tree_impl());
287 } 287 }
288 288
289 void LayerImpl::AppendDebugBorderQuad( 289 void LayerImpl::AppendDebugBorderQuad(
290 QuadSink* quad_sink, 290 QuadSink* quad_sink,
291 const SharedQuadState* shared_quad_state, 291 const SharedQuadState* shared_quad_state,
292 AppendQuadsData* append_quads_data) const { 292 AppendQuadsData* append_quads_data) const {
293 SkColor color; 293 SkColor color;
294 float width; 294 float width;
295 GetDebugBorderProperties(&color, &width); 295 GetDebugBorderProperties(&color, &width);
296 AppendDebugBorderQuad( 296 AppendDebugBorderQuad(quad_sink,
297 quad_sink, shared_quad_state, append_quads_data, color, width); 297 content_bounds(),
298 shared_quad_state,
299 append_quads_data,
300 color,
301 width);
302 }
303
304 void LayerImpl::AppendDebugBorderQuad(
305 QuadSink* quad_sink,
306 const gfx::Size& content_bounds,
307 const SharedQuadState* shared_quad_state,
308 AppendQuadsData* append_quads_data) const {
309 SkColor color;
310 float width;
311 GetDebugBorderProperties(&color, &width);
312 AppendDebugBorderQuad(quad_sink,
313 content_bounds,
314 shared_quad_state,
315 append_quads_data,
316 color,
317 width);
298 } 318 }
299 319
300 void LayerImpl::AppendDebugBorderQuad(QuadSink* quad_sink, 320 void LayerImpl::AppendDebugBorderQuad(QuadSink* quad_sink,
321 const gfx::Size& content_bounds,
301 const SharedQuadState* shared_quad_state, 322 const SharedQuadState* shared_quad_state,
302 AppendQuadsData* append_quads_data, 323 AppendQuadsData* append_quads_data,
303 SkColor color, 324 SkColor color,
304 float width) const { 325 float width) const {
305 if (!ShowDebugBorders()) 326 if (!ShowDebugBorders())
306 return; 327 return;
307 328
308 gfx::Rect quad_rect(content_bounds()); 329 gfx::Rect quad_rect(content_bounds);
309 gfx::Rect visible_quad_rect(quad_rect); 330 gfx::Rect visible_quad_rect(quad_rect);
310 scoped_ptr<DebugBorderDrawQuad> debug_border_quad = 331 scoped_ptr<DebugBorderDrawQuad> debug_border_quad =
311 DebugBorderDrawQuad::Create(); 332 DebugBorderDrawQuad::Create();
312 debug_border_quad->SetNew( 333 debug_border_quad->SetNew(
313 shared_quad_state, quad_rect, visible_quad_rect, color, width); 334 shared_quad_state, quad_rect, visible_quad_rect, color, width);
314 quad_sink->Append(debug_border_quad.PassAs<DrawQuad>()); 335 quad_sink->Append(debug_border_quad.PassAs<DrawQuad>());
315 } 336 }
316 337
317 bool LayerImpl::HasDelegatedContent() const { 338 bool LayerImpl::HasDelegatedContent() const {
318 return false; 339 return false;
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 scoped_ptr<base::Value> LayerImpl::AsValue() const { 1502 scoped_ptr<base::Value> LayerImpl::AsValue() const {
1482 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 1503 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
1483 AsValueInto(state.get()); 1504 AsValueInto(state.get());
1484 return state.PassAs<base::Value>(); 1505 return state.PassAs<base::Value>();
1485 } 1506 }
1486 1507
1487 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { 1508 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) {
1488 benchmark->RunOnLayer(this); 1509 benchmark->RunOnLayer(this);
1489 } 1510 }
1490 } // namespace cc 1511 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698