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

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

Issue 1140913002: Add Layer Id information to the LayerTree json string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding only layer id to the json! Created 5 years, 7 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 | « no previous file | no next file » | 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/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "base/trace_event/trace_event_argument.h" 10 #include "base/trace_event/trace_event_argument.h"
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 // 649 //
650 gfx::Vector2dF delta_from_pinch = 650 gfx::Vector2dF delta_from_pinch =
651 gfx::Rect(scroll_clip_layer_->bounds()).bottom_right() - gfx::PointF(); 651 gfx::Rect(scroll_clip_layer_->bounds()).bottom_right() - gfx::PointF();
652 delta_from_pinch.Scale((1.f - scale_delta) / (scale * scale_delta)); 652 delta_from_pinch.Scale((1.f - scale_delta) / (scale * scale_delta));
653 653
654 return delta_from_scroll + delta_from_pinch; 654 return delta_from_scroll + delta_from_pinch;
655 } 655 }
656 656
657 base::DictionaryValue* LayerImpl::LayerTreeAsJson() const { 657 base::DictionaryValue* LayerImpl::LayerTreeAsJson() const {
658 base::DictionaryValue* result = new base::DictionaryValue; 658 base::DictionaryValue* result = new base::DictionaryValue;
659 result->SetInteger("LayerId", id());
659 result->SetString("LayerType", LayerTypeAsString()); 660 result->SetString("LayerType", LayerTypeAsString());
660 661
661 base::ListValue* list = new base::ListValue; 662 base::ListValue* list = new base::ListValue;
662 list->AppendInteger(bounds().width()); 663 list->AppendInteger(bounds().width());
663 list->AppendInteger(bounds().height()); 664 list->AppendInteger(bounds().height());
664 result->Set("Bounds", list); 665 result->Set("Bounds", list);
665 666
666 list = new base::ListValue; 667 list = new base::ListValue;
667 list->AppendDouble(position_.x()); 668 list->AppendDouble(position_.x());
668 list->AppendDouble(position_.y()); 669 list->AppendDouble(position_.y());
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 gfx::Transform scaled_draw_transform = 1636 gfx::Transform scaled_draw_transform =
1636 draw_properties_.target_space_transform; 1637 draw_properties_.target_space_transform;
1637 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); 1638 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale);
1638 gfx::Size scaled_content_bounds = 1639 gfx::Size scaled_content_bounds =
1639 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); 1640 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale));
1640 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, 1641 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform,
1641 gfx::Rect(scaled_content_bounds)); 1642 gfx::Rect(scaled_content_bounds));
1642 } 1643 }
1643 1644
1644 } // namespace cc 1645 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698