Chromium Code Reviews| 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->SetString("Layer", base::StringPrintf("%p", this)); | |
|
danakj
2015/05/13 16:50:04
What does the pointer do for you that the id doesn
| |
| 660 result->SetInteger("LayerId", id()); | |
| 659 result->SetString("LayerType", LayerTypeAsString()); | 661 result->SetString("LayerType", LayerTypeAsString()); |
| 660 | 662 |
| 661 base::ListValue* list = new base::ListValue; | 663 base::ListValue* list = new base::ListValue; |
| 662 list->AppendInteger(bounds().width()); | 664 list->AppendInteger(bounds().width()); |
| 663 list->AppendInteger(bounds().height()); | 665 list->AppendInteger(bounds().height()); |
| 664 result->Set("Bounds", list); | 666 result->Set("Bounds", list); |
| 665 | 667 |
| 666 list = new base::ListValue; | 668 list = new base::ListValue; |
| 667 list->AppendDouble(position_.x()); | 669 list->AppendDouble(position_.x()); |
| 668 list->AppendDouble(position_.y()); | 670 list->AppendDouble(position_.y()); |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1635 gfx::Transform scaled_draw_transform = | 1637 gfx::Transform scaled_draw_transform = |
| 1636 draw_properties_.target_space_transform; | 1638 draw_properties_.target_space_transform; |
| 1637 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); | 1639 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); |
| 1638 gfx::Size scaled_content_bounds = | 1640 gfx::Size scaled_content_bounds = |
| 1639 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); | 1641 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); |
| 1640 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, | 1642 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, |
| 1641 gfx::Rect(scaled_content_bounds)); | 1643 gfx::Rect(scaled_content_bounds)); |
| 1642 } | 1644 } |
| 1643 | 1645 |
| 1644 } // namespace cc | 1646 } // namespace cc |
| OLD | NEW |