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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |