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

Side by Side Diff: ui/compositor/dip_util.cc

Issue 1101823002: CC Animations: Make LayerAnimationController creation optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up. Created 5 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/compositor/dip_util.h" 5 #include "ui/compositor/dip_util.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "cc/layers/layer.h" 8 #include "cc/layers/layer.h"
9 #include "ui/compositor/compositor.h" 9 #include "ui/compositor/compositor.h"
10 #include "ui/compositor/compositor_switches.h" 10 #include "ui/compositor/compositor_switches.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 layer_to_snap->SetSubpixelPositionOffset(fudge); 96 layer_to_snap->SetSubpixelPositionOffset(fudge);
97 #if DCHECK_IS_ON() 97 #if DCHECK_IS_ON()
98 gfx::Point layer_offset; 98 gfx::Point layer_offset;
99 gfx::PointF origin; 99 gfx::PointF origin;
100 Layer::ConvertPointToLayer( 100 Layer::ConvertPointToLayer(
101 layer_to_snap->parent(), snapped_layer, &layer_offset); 101 layer_to_snap->parent(), snapped_layer, &layer_offset);
102 if (layer_to_snap->GetAnimator()->is_animating()) { 102 if (layer_to_snap->GetAnimator()->is_animating()) {
103 origin = layer_to_snap->GetTargetBounds().origin() + 103 origin = layer_to_snap->GetTargetBounds().origin() +
104 layer_to_snap->subpixel_position_offset(); 104 layer_to_snap->subpixel_position_offset();
105 } else { 105 } else {
106 cc::Layer* cc_layer = layer_to_snap->cc_layer(); 106 origin = layer_to_snap->position();
107 origin = cc_layer->position();
108 } 107 }
109 CheckSnapped((layer_offset.x() + origin.x()) * scale_factor); 108 CheckSnapped((layer_offset.x() + origin.x()) * scale_factor);
110 CheckSnapped((layer_offset.y() + origin.y()) * scale_factor); 109 CheckSnapped((layer_offset.y() + origin.y()) * scale_factor);
111 #endif 110 #endif
112 } 111 }
113 112
114 } // namespace ui 113 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/compositor.cc ('k') | ui/compositor/layer.h » ('j') | ui/compositor/layer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698