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

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

Issue 139233002: [#4] Pass gfx structs by const ref (gfx::PointF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected as per review comments! Created 6 years, 11 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
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_position_constraint_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "cc/animation/animation_registrar.h" 10 #include "cc/animation/animation_registrar.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 if (active_twin) { 403 if (active_twin) {
404 // Scrolls that happens after begin frame (where the sent scroll delta 404 // Scrolls that happens after begin frame (where the sent scroll delta
405 // comes from) and commit need to be applied to the pending tree 405 // comes from) and commit need to be applied to the pending tree
406 // so that it is up to date with the total scroll. 406 // so that it is up to date with the total scroll.
407 SetScrollDelta(active_twin->ScrollDelta() - 407 SetScrollDelta(active_twin->ScrollDelta() -
408 active_twin->sent_scroll_delta()); 408 active_twin->sent_scroll_delta());
409 } 409 }
410 } 410 }
411 411
412 InputHandler::ScrollStatus LayerImpl::TryScroll( 412 InputHandler::ScrollStatus LayerImpl::TryScroll(
413 gfx::PointF screen_space_point, 413 const gfx::PointF& screen_space_point,
414 InputHandler::ScrollInputType type) const { 414 InputHandler::ScrollInputType type) const {
415 if (should_scroll_on_main_thread()) { 415 if (should_scroll_on_main_thread()) {
416 TRACE_EVENT0("cc", "LayerImpl::TryScroll: Failed ShouldScrollOnMainThread"); 416 TRACE_EVENT0("cc", "LayerImpl::TryScroll: Failed ShouldScrollOnMainThread");
417 return InputHandler::ScrollOnMainThread; 417 return InputHandler::ScrollOnMainThread;
418 } 418 }
419 419
420 if (!screen_space_transform().IsInvertible()) { 420 if (!screen_space_transform().IsInvertible()) {
421 TRACE_EVENT0("cc", "LayerImpl::TryScroll: Ignored NonInvertibleTransform"); 421 TRACE_EVENT0("cc", "LayerImpl::TryScroll: Ignored NonInvertibleTransform");
422 return InputHandler::ScrollIgnored; 422 return InputHandler::ScrollIgnored;
423 } 423 }
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 } 784 }
785 785
786 void LayerImpl::SetHideLayerAndSubtree(bool hide) { 786 void LayerImpl::SetHideLayerAndSubtree(bool hide) {
787 if (hide_layer_and_subtree_ == hide) 787 if (hide_layer_and_subtree_ == hide)
788 return; 788 return;
789 789
790 hide_layer_and_subtree_ = hide; 790 hide_layer_and_subtree_ = hide;
791 NoteLayerPropertyChangedForSubtree(); 791 NoteLayerPropertyChangedForSubtree();
792 } 792 }
793 793
794 void LayerImpl::SetAnchorPoint(gfx::PointF anchor_point) { 794 void LayerImpl::SetAnchorPoint(const gfx::PointF& anchor_point) {
795 if (anchor_point_ == anchor_point) 795 if (anchor_point_ == anchor_point)
796 return; 796 return;
797 797
798 anchor_point_ = anchor_point; 798 anchor_point_ = anchor_point;
799 NoteLayerPropertyChangedForSubtree(); 799 NoteLayerPropertyChangedForSubtree();
800 } 800 }
801 801
802 void LayerImpl::SetAnchorPointZ(float anchor_point_z) { 802 void LayerImpl::SetAnchorPointZ(float anchor_point_z) {
803 if (anchor_point_z_ == anchor_point_z) 803 if (anchor_point_z_ == anchor_point_z)
804 return; 804 return;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 NoteLayerPropertyChangedForSubtree(); 903 NoteLayerPropertyChangedForSubtree();
904 } 904 }
905 905
906 void LayerImpl::SetIsRootForIsolatedGroup(bool root) { 906 void LayerImpl::SetIsRootForIsolatedGroup(bool root) {
907 if (is_root_for_isolated_group_ == root) 907 if (is_root_for_isolated_group_ == root)
908 return; 908 return;
909 909
910 is_root_for_isolated_group_ = root; 910 is_root_for_isolated_group_ = root;
911 } 911 }
912 912
913 void LayerImpl::SetPosition(gfx::PointF position) { 913 void LayerImpl::SetPosition(const gfx::PointF& position) {
914 if (position_ == position) 914 if (position_ == position)
915 return; 915 return;
916 916
917 position_ = position; 917 position_ = position;
918 NoteLayerPropertyChangedForSubtree(); 918 NoteLayerPropertyChangedForSubtree();
919 } 919 }
920 920
921 void LayerImpl::SetPreserves3d(bool preserves3_d) { 921 void LayerImpl::SetPreserves3d(bool preserves3_d) {
922 if (preserves_3d_ == preserves3_d) 922 if (preserves_3d_ == preserves3_d)
923 return; 923 return;
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 1271 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
1272 AsValueInto(state.get()); 1272 AsValueInto(state.get());
1273 return state.PassAs<base::Value>(); 1273 return state.PassAs<base::Value>();
1274 } 1274 }
1275 1275
1276 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { 1276 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) {
1277 benchmark->RunOnLayer(this); 1277 benchmark->RunOnLayer(this);
1278 } 1278 }
1279 1279
1280 } // namespace cc 1280 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_position_constraint_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698