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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 float contents_scale_y) { | 1143 float contents_scale_y) { |
1144 if (this->contents_scale_x() == contents_scale_x && | 1144 if (this->contents_scale_x() == contents_scale_x && |
1145 this->contents_scale_y() == contents_scale_y) | 1145 this->contents_scale_y() == contents_scale_y) |
1146 return; | 1146 return; |
1147 | 1147 |
1148 draw_properties_.contents_scale_x = contents_scale_x; | 1148 draw_properties_.contents_scale_x = contents_scale_x; |
1149 draw_properties_.contents_scale_y = contents_scale_y; | 1149 draw_properties_.contents_scale_y = contents_scale_y; |
1150 NoteLayerPropertyChanged(); | 1150 NoteLayerPropertyChanged(); |
1151 } | 1151 } |
1152 | 1152 |
1153 bool LayerImpl::IsExternalFlingActive() const { | 1153 bool LayerImpl::IsExternalScrollActive() const { |
1154 return layer_tree_impl_->IsExternalFlingActive(); | 1154 return layer_tree_impl_->IsExternalScrollActive(); |
1155 } | 1155 } |
1156 | 1156 |
1157 void LayerImpl::SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset) { | 1157 void LayerImpl::SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset) { |
1158 DCHECK(IsActive()); | 1158 DCHECK(IsActive()); |
1159 if (scroll_offset_->SetCurrent(scroll_offset)) | 1159 if (scroll_offset_->SetCurrent(scroll_offset)) |
1160 DidUpdateScrollOffset(false); | 1160 DidUpdateScrollOffset(false); |
1161 } | 1161 } |
1162 | 1162 |
1163 void LayerImpl::SetCurrentScrollOffsetFromDelegate( | 1163 void LayerImpl::SetCurrentScrollOffsetFromDelegate( |
1164 const gfx::ScrollOffset& scroll_offset) { | 1164 const gfx::ScrollOffset& scroll_offset) { |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 gfx::Transform scaled_draw_transform = | 1675 gfx::Transform scaled_draw_transform = |
1676 draw_properties_.target_space_transform; | 1676 draw_properties_.target_space_transform; |
1677 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); | 1677 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); |
1678 gfx::Size scaled_content_bounds = | 1678 gfx::Size scaled_content_bounds = |
1679 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); | 1679 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); |
1680 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, | 1680 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, |
1681 gfx::Rect(scaled_content_bounds)); | 1681 gfx::Rect(scaled_content_bounds)); |
1682 } | 1682 } |
1683 | 1683 |
1684 } // namespace cc | 1684 } // namespace cc |
OLD | NEW |