Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Side by Side Diff: cc/layers/layer_impl.cc

Issue 1063853005: Unify Android Webview and Chrome's fling (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 gfx::Transform scaled_draw_transform = 1635 gfx::Transform scaled_draw_transform =
1636 draw_properties_.target_space_transform; 1636 draw_properties_.target_space_transform;
1637 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); 1637 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale);
1638 gfx::Size scaled_content_bounds = 1638 gfx::Size scaled_content_bounds =
1639 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale)); 1639 gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), scale));
1640 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, 1640 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform,
1641 gfx::Rect(scaled_content_bounds)); 1641 gfx::Rect(scaled_content_bounds));
1642 } 1642 }
1643 1643
1644 } // namespace cc 1644 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698