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

Side by Side Diff: cc/trees/property_tree.cc

Issue 2445093002: cc/blimp: Add synchronization for scroll/scale state. (Closed)
Patch Set: Addressed comments Created 4 years, 1 month 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
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/property_tree.h ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 1665
1666 bool ScrollTree::SetScrollOffset(int layer_id, 1666 bool ScrollTree::SetScrollOffset(int layer_id,
1667 const gfx::ScrollOffset& scroll_offset) { 1667 const gfx::ScrollOffset& scroll_offset) {
1668 if (property_trees()->is_main_thread) 1668 if (property_trees()->is_main_thread)
1669 return synced_scroll_offset(layer_id)->PushFromMainThread(scroll_offset); 1669 return synced_scroll_offset(layer_id)->PushFromMainThread(scroll_offset);
1670 else if (property_trees()->is_active) 1670 else if (property_trees()->is_active)
1671 return synced_scroll_offset(layer_id)->SetCurrent(scroll_offset); 1671 return synced_scroll_offset(layer_id)->SetCurrent(scroll_offset);
1672 return false; 1672 return false;
1673 } 1673 }
1674 1674
1675 void ScrollTree::AddUnappliedScrollOffsetDeltaToPendingTree(
1676 int layer_id,
1677 const gfx::ScrollOffset& scroll_offset_delta) {
1678 DCHECK(!property_trees()->is_main_thread);
1679 DCHECK(!property_trees()->is_active);
1680
1681 synced_scroll_offset(layer_id)->AddUnappliedDeltaToPendingBase(
1682 scroll_offset_delta);
1683 }
1684
1675 bool ScrollTree::UpdateScrollOffsetBaseForTesting( 1685 bool ScrollTree::UpdateScrollOffsetBaseForTesting(
1676 int layer_id, 1686 int layer_id,
1677 const gfx::ScrollOffset& offset) { 1687 const gfx::ScrollOffset& offset) {
1678 DCHECK(!property_trees()->is_main_thread); 1688 DCHECK(!property_trees()->is_main_thread);
1679 bool changed = synced_scroll_offset(layer_id)->PushFromMainThread(offset); 1689 bool changed = synced_scroll_offset(layer_id)->PushFromMainThread(offset);
1680 if (property_trees()->is_active) 1690 if (property_trees()->is_active)
1681 changed |= synced_scroll_offset(layer_id)->PushPendingToActive(); 1691 changed |= synced_scroll_offset(layer_id)->PushPendingToActive();
1682 return changed; 1692 return changed;
1683 } 1693 }
1684 1694
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 2378
2369 const EffectNode* effect_node = effect_tree.Node(effect_id); 2379 const EffectNode* effect_node = effect_tree.Node(effect_id);
2370 2380
2371 bool success = GetFromTarget(transform_id, effect_id, transform); 2381 bool success = GetFromTarget(transform_id, effect_id, transform);
2372 transform->Scale(effect_node->surface_contents_scale.x(), 2382 transform->Scale(effect_node->surface_contents_scale.x(),
2373 effect_node->surface_contents_scale.y()); 2383 effect_node->surface_contents_scale.y());
2374 return success; 2384 return success;
2375 } 2385 }
2376 2386
2377 } // namespace cc 2387 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/property_tree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698