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

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

Issue 13725015: Merge ui::Layer's concept of position with cc::Layer's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/compositor/layer_animation_element.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/layer_animation_sequence.h" 5 #include "ui/compositor/layer_animation_sequence.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } 176 }
177 177
178 bool LayerAnimationSequence::HasConflictingProperty( 178 bool LayerAnimationSequence::HasConflictingProperty(
179 const LayerAnimationElement::AnimatableProperties& other) const { 179 const LayerAnimationElement::AnimatableProperties& other) const {
180 LayerAnimationElement::AnimatableProperties intersection; 180 LayerAnimationElement::AnimatableProperties intersection;
181 std::insert_iterator<LayerAnimationElement::AnimatableProperties> ii( 181 std::insert_iterator<LayerAnimationElement::AnimatableProperties> ii(
182 intersection, intersection.begin()); 182 intersection, intersection.begin());
183 std::set_intersection(properties_.begin(), properties_.end(), 183 std::set_intersection(properties_.begin(), properties_.end(),
184 other.begin(), other.end(), 184 other.begin(), other.end(),
185 ii); 185 ii);
186 if (intersection.size() > 0) 186 return (intersection.size() > 0);
187 return true;
188
189 if (properties_.find(LayerAnimationElement::TRANSFORM) != properties_.end() &&
190 other.find(LayerAnimationElement::BOUNDS) != other.end())
191 return true;
192
193 if (properties_.find(LayerAnimationElement::BOUNDS) != properties_.end() &&
194 other.find(LayerAnimationElement::TRANSFORM) != other.end())
195 return true;
196
197 return false;
198 } 187 }
199 188
200 bool LayerAnimationSequence::IsFirstElementThreaded() const { 189 bool LayerAnimationSequence::IsFirstElementThreaded() const {
201 if (!elements_.empty()) 190 if (!elements_.empty())
202 return elements_[0]->IsThreaded(); 191 return elements_[0]->IsThreaded();
203 192
204 return false; 193 return false;
205 } 194 }
206 195
207 void LayerAnimationSequence::AddObserver(LayerAnimationObserver* observer) { 196 void LayerAnimationSequence::AddObserver(LayerAnimationObserver* observer) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 259
271 LayerAnimationElement* LayerAnimationSequence::CurrentElement() { 260 LayerAnimationElement* LayerAnimationSequence::CurrentElement() {
272 if (elements_.empty()) 261 if (elements_.empty())
273 return NULL; 262 return NULL;
274 263
275 size_t current_index = last_element_ % elements_.size(); 264 size_t current_index = last_element_ % elements_.size();
276 return elements_[current_index].get(); 265 return elements_[current_index].get();
277 } 266 }
278 267
279 } // namespace ui 268 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer_animation_element.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698