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

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: avoid extra overload function 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
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/nine_patch_layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/nine_patch_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698