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

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

Issue 2680953002: Remove GraphicsLayer::didScroll and directly call ScrollableArea::didScroll (Closed)
Patch Set: Incorporate reviewer comments: more tests, less bad tests Created 3 years, 10 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 | « ui/compositor/layer.h ('k') | ui/views/controls/scroll_view.h » ('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 (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.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 if (layer_mask_) 813 if (layer_mask_)
814 layer_mask_->OnDeviceScaleFactorChanged(device_scale_factor); 814 layer_mask_->OnDeviceScaleFactorChanged(device_scale_factor);
815 } 815 }
816 816
817 void Layer::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) { 817 void Layer::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) {
818 DCHECK(surface_layer_.get()); 818 DCHECK(surface_layer_.get());
819 if (delegate_) 819 if (delegate_)
820 delegate_->OnDelegatedFrameDamage(damage_rect_in_dip); 820 delegate_->OnDelegatedFrameDamage(damage_rect_in_dip);
821 } 821 }
822 822
823 void Layer::SetScrollable(Layer* parent_clip_layer, 823 void Layer::SetScrollable(
824 const base::Closure& on_scroll) { 824 Layer* parent_clip_layer,
825 const base::Callback<void(const gfx::ScrollOffset&)>& on_scroll) {
825 cc_layer_->SetScrollClipLayerId(parent_clip_layer->cc_layer_->id()); 826 cc_layer_->SetScrollClipLayerId(parent_clip_layer->cc_layer_->id());
826 cc_layer_->set_did_scroll_callback(on_scroll); 827 cc_layer_->set_did_scroll_callback(on_scroll);
827 cc_layer_->SetUserScrollable(true, true); 828 cc_layer_->SetUserScrollable(true, true);
828 } 829 }
829 830
830 gfx::ScrollOffset Layer::CurrentScrollOffset() const { 831 gfx::ScrollOffset Layer::CurrentScrollOffset() const {
831 const Compositor* compositor = GetCompositor(); 832 const Compositor* compositor = GetCompositor();
832 gfx::ScrollOffset offset; 833 gfx::ScrollOffset offset;
833 if (compositor && 834 if (compositor &&
834 compositor->GetScrollOffsetForLayer(cc_layer_->id(), &offset)) 835 compositor->GetScrollOffsetForLayer(cc_layer_->id(), &offset))
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1173 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1173 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1174 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1174 return mirror_ptr.get() == mirror; 1175 return mirror_ptr.get() == mirror;
1175 }); 1176 });
1176 1177
1177 DCHECK(it != mirrors_.end()); 1178 DCHECK(it != mirrors_.end());
1178 mirrors_.erase(it); 1179 mirrors_.erase(it);
1179 } 1180 }
1180 1181
1181 } // namespace ui 1182 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/views/controls/scroll_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698