| 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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 float contents_scale_y) { | 1124 float contents_scale_y) { |
| 1125 if (this->contents_scale_x() == contents_scale_x && | 1125 if (this->contents_scale_x() == contents_scale_x && |
| 1126 this->contents_scale_y() == contents_scale_y) | 1126 this->contents_scale_y() == contents_scale_y) |
| 1127 return; | 1127 return; |
| 1128 | 1128 |
| 1129 draw_properties_.contents_scale_x = contents_scale_x; | 1129 draw_properties_.contents_scale_x = contents_scale_x; |
| 1130 draw_properties_.contents_scale_y = contents_scale_y; | 1130 draw_properties_.contents_scale_y = contents_scale_y; |
| 1131 NoteLayerPropertyChanged(); | 1131 NoteLayerPropertyChanged(); |
| 1132 } | 1132 } |
| 1133 | 1133 |
| 1134 bool LayerImpl::IsExternalFlingActive() const { | 1134 bool LayerImpl::IsExternalScrollActive() const { |
| 1135 return layer_tree_impl_->IsExternalFlingActive(); | 1135 return layer_tree_impl_->IsExternalScrollActive(); |
| 1136 } | 1136 } |
| 1137 | 1137 |
| 1138 void LayerImpl::SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset) { | 1138 void LayerImpl::SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset) { |
| 1139 DCHECK(IsActive()); | 1139 DCHECK(IsActive()); |
| 1140 if (scroll_offset_->SetCurrent(scroll_offset)) | 1140 if (scroll_offset_->SetCurrent(scroll_offset)) |
| 1141 DidUpdateScrollOffset(false); | 1141 DidUpdateScrollOffset(false); |
| 1142 } | 1142 } |
| 1143 | 1143 |
| 1144 void LayerImpl::SetCurrentScrollOffsetFromDelegate( | 1144 void LayerImpl::SetCurrentScrollOffsetFromDelegate( |
| 1145 const gfx::ScrollOffset& scroll_offset) { | 1145 const gfx::ScrollOffset& scroll_offset) { |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 gfx::Transform scaled_draw_transform = | 1641 gfx::Transform scaled_draw_transform = |
| 1642 draw_properties_.target_space_transform; | 1642 draw_properties_.target_space_transform; |
| 1643 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); | 1643 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); |
| 1644 gfx::Size scaled_content_bounds = | 1644 gfx::Size scaled_content_bounds = |
| 1645 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); | 1645 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); |
| 1646 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, | 1646 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, |
| 1647 gfx::Rect(scaled_content_bounds)); | 1647 gfx::Rect(scaled_content_bounds)); |
| 1648 } | 1648 } |
| 1649 | 1649 |
| 1650 } // namespace cc | 1650 } // namespace cc |
| OLD | NEW |