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 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 float contents_scale_y) { | 1150 float contents_scale_y) { |
1151 if (this->contents_scale_x() == contents_scale_x && | 1151 if (this->contents_scale_x() == contents_scale_x && |
1152 this->contents_scale_y() == contents_scale_y) | 1152 this->contents_scale_y() == contents_scale_y) |
1153 return; | 1153 return; |
1154 | 1154 |
1155 draw_properties_.contents_scale_x = contents_scale_x; | 1155 draw_properties_.contents_scale_x = contents_scale_x; |
1156 draw_properties_.contents_scale_y = contents_scale_y; | 1156 draw_properties_.contents_scale_y = contents_scale_y; |
1157 NoteLayerPropertyChanged(); | 1157 NoteLayerPropertyChanged(); |
1158 } | 1158 } |
1159 | 1159 |
1160 bool LayerImpl::IsExternalFlingActive() const { | 1160 bool LayerImpl::IsExternalScrollActive() const { |
1161 return layer_tree_impl_->IsExternalFlingActive(); | 1161 return layer_tree_impl_->IsExternalScrollActive(); |
1162 } | 1162 } |
1163 | 1163 |
1164 void LayerImpl::SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset) { | 1164 void LayerImpl::SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset) { |
1165 DCHECK(IsActive()); | 1165 DCHECK(IsActive()); |
1166 if (scroll_offset_->SetCurrent(scroll_offset)) | 1166 if (scroll_offset_->SetCurrent(scroll_offset)) |
1167 DidUpdateScrollOffset(false); | 1167 DidUpdateScrollOffset(false); |
1168 } | 1168 } |
1169 | 1169 |
1170 void LayerImpl::SetCurrentScrollOffsetFromDelegate( | 1170 void LayerImpl::SetCurrentScrollOffsetFromDelegate( |
1171 const gfx::ScrollOffset& scroll_offset) { | 1171 const gfx::ScrollOffset& scroll_offset) { |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 gfx::Transform scaled_draw_transform = | 1681 gfx::Transform scaled_draw_transform = |
1682 draw_properties_.target_space_transform; | 1682 draw_properties_.target_space_transform; |
1683 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); | 1683 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); |
1684 gfx::Size scaled_content_bounds = | 1684 gfx::Size scaled_content_bounds = |
1685 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); | 1685 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); |
1686 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, | 1686 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, |
1687 gfx::Rect(scaled_content_bounds)); | 1687 gfx::Rect(scaled_content_bounds)); |
1688 } | 1688 } |
1689 | 1689 |
1690 } // namespace cc | 1690 } // namespace cc |
OLD | NEW |