| 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/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 base::saturated_cast<int>(GPUMemoryUsageInBytes())); | 1758 base::saturated_cast<int>(GPUMemoryUsageInBytes())); |
| 1759 | 1759 |
| 1760 MathUtil::AddToTracedValue( | 1760 MathUtil::AddToTracedValue( |
| 1761 "scroll_offset", scroll_offset_ ? scroll_offset_->Current(IsActive()) | 1761 "scroll_offset", scroll_offset_ ? scroll_offset_->Current(IsActive()) |
| 1762 : gfx::ScrollOffset(), | 1762 : gfx::ScrollOffset(), |
| 1763 state); | 1763 state); |
| 1764 | 1764 |
| 1765 MathUtil::AddToTracedValue("transform_origin", transform_origin_, state); | 1765 MathUtil::AddToTracedValue("transform_origin", transform_origin_, state); |
| 1766 | 1766 |
| 1767 bool clipped; | 1767 bool clipped; |
| 1768 gfx::QuadF layer_quad = MathUtil::MapQuad( | 1768 gfx::QuadF layer_quad = |
| 1769 screen_space_transform(), gfx::QuadF(gfx::Rect(bounds())), &clipped); | 1769 MathUtil::MapQuad(screen_space_transform(), |
| 1770 gfx::QuadF(gfx::RectF(gfx::Rect(bounds()))), &clipped); |
| 1770 MathUtil::AddToTracedValue("layer_quad", layer_quad, state); | 1771 MathUtil::AddToTracedValue("layer_quad", layer_quad, state); |
| 1771 if (!touch_event_handler_region_.IsEmpty()) { | 1772 if (!touch_event_handler_region_.IsEmpty()) { |
| 1772 state->BeginArray("touch_event_handler_region"); | 1773 state->BeginArray("touch_event_handler_region"); |
| 1773 touch_event_handler_region_.AsValueInto(state); | 1774 touch_event_handler_region_.AsValueInto(state); |
| 1774 state->EndArray(); | 1775 state->EndArray(); |
| 1775 } | 1776 } |
| 1776 if (have_wheel_event_handlers_) { | 1777 if (have_wheel_event_handlers_) { |
| 1777 gfx::Rect wheel_rect(bounds()); | 1778 gfx::Rect wheel_rect(bounds()); |
| 1778 Region wheel_region(wheel_rect); | 1779 Region wheel_region(wheel_rect); |
| 1779 state->BeginArray("wheel_event_handler_region"); | 1780 state->BeginArray("wheel_event_handler_region"); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1933 } | 1934 } |
| 1934 | 1935 |
| 1935 // TODO(enne): the transform needs to come from property trees instead of | 1936 // TODO(enne): the transform needs to come from property trees instead of |
| 1936 // draw properties. | 1937 // draw properties. |
| 1937 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1938 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
| 1938 draw_properties().target_space_transform, default_scale); | 1939 draw_properties().target_space_transform, default_scale); |
| 1939 return std::max(transform_scales.x(), transform_scales.y()); | 1940 return std::max(transform_scales.x(), transform_scales.y()); |
| 1940 } | 1941 } |
| 1941 | 1942 |
| 1942 } // namespace cc | 1943 } // namespace cc |
| OLD | NEW |