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 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1515 LayerTypeAsString(), | 1515 LayerTypeAsString(), |
1516 this); | 1516 this); |
1517 state->SetInteger("layer_id", id()); | 1517 state->SetInteger("layer_id", id()); |
1518 MathUtil::AddToTracedValue("bounds", bounds_, state); | 1518 MathUtil::AddToTracedValue("bounds", bounds_, state); |
1519 | 1519 |
1520 state->SetDouble("opacity", opacity()); | 1520 state->SetDouble("opacity", opacity()); |
1521 | 1521 |
1522 MathUtil::AddToTracedValue("position", position_, state); | 1522 MathUtil::AddToTracedValue("position", position_, state); |
1523 | 1523 |
1524 state->SetInteger("draws_content", DrawsContent()); | 1524 state->SetInteger("draws_content", DrawsContent()); |
1525 state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); | 1525 state->SetInteger("gpu_memory_usage", |
| 1526 static_cast<int>(GPUMemoryUsageInBytes())); |
1526 | 1527 |
1527 MathUtil::AddToTracedValue( | 1528 MathUtil::AddToTracedValue( |
1528 "scroll_offset", scroll_offset_ ? scroll_offset_->Current(IsActive()) | 1529 "scroll_offset", scroll_offset_ ? scroll_offset_->Current(IsActive()) |
1529 : gfx::ScrollOffset(), | 1530 : gfx::ScrollOffset(), |
1530 state); | 1531 state); |
1531 | 1532 |
1532 MathUtil::AddToTracedValue("transform_origin", transform_origin_, state); | 1533 MathUtil::AddToTracedValue("transform_origin", transform_origin_, state); |
1533 | 1534 |
1534 bool clipped; | 1535 bool clipped; |
1535 gfx::QuadF layer_quad = MathUtil::MapQuad( | 1536 gfx::QuadF layer_quad = MathUtil::MapQuad( |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 gfx::Transform scaled_draw_transform = | 1683 gfx::Transform scaled_draw_transform = |
1683 draw_properties_.target_space_transform; | 1684 draw_properties_.target_space_transform; |
1684 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); | 1685 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); |
1685 gfx::Size scaled_content_bounds = | 1686 gfx::Size scaled_content_bounds = |
1686 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); | 1687 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); |
1687 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, | 1688 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, |
1688 gfx::Rect(scaled_content_bounds)); | 1689 gfx::Rect(scaled_content_bounds)); |
1689 } | 1690 } |
1690 | 1691 |
1691 } // namespace cc | 1692 } // namespace cc |
OLD | NEW |