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

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

Issue 2445093002: cc/blimp: Add synchronization for scroll/scale state. (Closed)
Patch Set: minor fix 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 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 1628
1629 bool ScrollTree::SetScrollOffset(int layer_id, 1629 bool ScrollTree::SetScrollOffset(int layer_id,
1630 const gfx::ScrollOffset& scroll_offset) { 1630 const gfx::ScrollOffset& scroll_offset) {
1631 if (property_trees()->is_main_thread) 1631 if (property_trees()->is_main_thread)
1632 return synced_scroll_offset(layer_id)->PushFromMainThread(scroll_offset); 1632 return synced_scroll_offset(layer_id)->PushFromMainThread(scroll_offset);
1633 else if (property_trees()->is_active) 1633 else if (property_trees()->is_active)
1634 return synced_scroll_offset(layer_id)->SetCurrent(scroll_offset); 1634 return synced_scroll_offset(layer_id)->SetCurrent(scroll_offset);
1635 return false; 1635 return false;
1636 } 1636 }
1637 1637
1638 void ScrollTree::AddUnappliedDeltaOnPendingTree(
1639 int layer_id,
1640 const gfx::ScrollOffset& scroll_offset_delta) {
1641 DCHECK(!property_trees()->is_main_thread);
1642 DCHECK(!property_trees()->is_active);
1643
1644 synced_scroll_offset(layer_id)->AddUnappliedDeltaToPendingBase(
1645 scroll_offset_delta);
1646 }
1647
1638 bool ScrollTree::UpdateScrollOffsetBaseForTesting( 1648 bool ScrollTree::UpdateScrollOffsetBaseForTesting(
1639 int layer_id, 1649 int layer_id,
1640 const gfx::ScrollOffset& offset) { 1650 const gfx::ScrollOffset& offset) {
1641 DCHECK(!property_trees()->is_main_thread); 1651 DCHECK(!property_trees()->is_main_thread);
1642 bool changed = synced_scroll_offset(layer_id)->PushFromMainThread(offset); 1652 bool changed = synced_scroll_offset(layer_id)->PushFromMainThread(offset);
1643 if (property_trees()->is_active) 1653 if (property_trees()->is_active)
1644 changed |= synced_scroll_offset(layer_id)->PushPendingToActive(); 1654 changed |= synced_scroll_offset(layer_id)->PushPendingToActive();
1645 return changed; 1655 return changed;
1646 } 1656 }
1647 1657
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
2332 2342
2333 const EffectNode* effect_node = effect_tree.Node(effect_id); 2343 const EffectNode* effect_node = effect_tree.Node(effect_id);
2334 2344
2335 bool success = GetFromTarget(transform_id, effect_id, transform); 2345 bool success = GetFromTarget(transform_id, effect_id, transform);
2336 transform->Scale(effect_node->surface_contents_scale.x(), 2346 transform->Scale(effect_node->surface_contents_scale.x(),
2337 effect_node->surface_contents_scale.y()); 2347 effect_node->surface_contents_scale.y());
2338 return success; 2348 return success;
2339 } 2349 }
2340 2350
2341 } // namespace cc 2351 } // 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