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

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

Issue 2018263002: Change LayerImpl::LayerTreeAsJson to return a std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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.h » ('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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 490
491 gfx::Vector2dF LayerImpl::FixedContainerSizeDelta() const { 491 gfx::Vector2dF LayerImpl::FixedContainerSizeDelta() const {
492 LayerImpl* scroll_clip_layer = 492 LayerImpl* scroll_clip_layer =
493 layer_tree_impl()->LayerById(scroll_clip_layer_id_); 493 layer_tree_impl()->LayerById(scroll_clip_layer_id_);
494 if (!scroll_clip_layer) 494 if (!scroll_clip_layer)
495 return gfx::Vector2dF(); 495 return gfx::Vector2dF();
496 496
497 return scroll_clip_layer->bounds_delta(); 497 return scroll_clip_layer->bounds_delta();
498 } 498 }
499 499
500 base::DictionaryValue* LayerImpl::LayerTreeAsJson() const { 500 std::unique_ptr<base::DictionaryValue> LayerImpl::LayerTreeAsJson() const {
501 base::DictionaryValue* result = new base::DictionaryValue; 501 std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue);
502 result->SetInteger("LayerId", id()); 502 result->SetInteger("LayerId", id());
503 result->SetString("LayerType", LayerTypeAsString()); 503 result->SetString("LayerType", LayerTypeAsString());
504 504
505 base::ListValue* list = new base::ListValue; 505 base::ListValue* list = new base::ListValue;
506 list->AppendInteger(bounds().width()); 506 list->AppendInteger(bounds().width());
507 list->AppendInteger(bounds().height()); 507 list->AppendInteger(bounds().height());
508 result->Set("Bounds", list); 508 result->Set("Bounds", list);
509 509
510 list = new base::ListValue; 510 list = new base::ListValue;
511 list->AppendDouble(position_.x()); 511 list->AppendDouble(position_.x());
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 .layer_transforms_should_scale_layer_contents) { 1395 .layer_transforms_should_scale_layer_contents) {
1396 return default_scale; 1396 return default_scale;
1397 } 1397 }
1398 1398
1399 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( 1399 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents(
1400 ScreenSpaceTransform(), default_scale); 1400 ScreenSpaceTransform(), default_scale);
1401 return std::max(transform_scales.x(), transform_scales.y()); 1401 return std::max(transform_scales.x(), transform_scales.y());
1402 } 1402 }
1403 1403
1404 } // namespace cc 1404 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/nine_patch_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698