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