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

Side by Side Diff: cc/layers/scrollbar_layer_impl_base.cc

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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 | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/surface_layer_impl.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/layers/scrollbar_layer_impl_base.h" 5 #include "cc/layers/scrollbar_layer_impl_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include "cc/trees/layer_tree_impl.h" 8 #include "cc/trees/layer_tree_impl.h"
9 #include "ui/gfx/geometry/rect_conversions.h" 9 #include "ui/gfx/geometry/rect_conversions.h"
10 10
(...skipping 15 matching lines...) Expand all
26 orientation_(orientation), 26 orientation_(orientation),
27 is_left_side_vertical_scrollbar_(is_left_side_vertical_scrollbar), 27 is_left_side_vertical_scrollbar_(is_left_side_vertical_scrollbar),
28 vertical_adjust_(0.f), 28 vertical_adjust_(0.f),
29 visible_to_total_length_ratio_(1.f) { 29 visible_to_total_length_ratio_(1.f) {
30 } 30 }
31 31
32 ScrollbarLayerImplBase::~ScrollbarLayerImplBase() {} 32 ScrollbarLayerImplBase::~ScrollbarLayerImplBase() {}
33 33
34 void ScrollbarLayerImplBase::PushPropertiesTo(LayerImpl* layer) { 34 void ScrollbarLayerImplBase::PushPropertiesTo(LayerImpl* layer) {
35 float active_opacity = layer->opacity(); 35 float active_opacity = layer->opacity();
36 bool active_hidden = layer->hide_layer_and_subtree();
36 LayerImpl::PushPropertiesTo(layer); 37 LayerImpl::PushPropertiesTo(layer);
37 layer->SetOpacity(active_opacity); 38 layer->SetOpacity(active_opacity);
39 layer->SetHideLayerAndSubtree(active_hidden);
38 DCHECK(layer->ToScrollbarLayer()); 40 DCHECK(layer->ToScrollbarLayer());
39 layer->ToScrollbarLayer()->set_is_overlay_scrollbar(is_overlay_scrollbar_); 41 layer->ToScrollbarLayer()->set_is_overlay_scrollbar(is_overlay_scrollbar_);
40 PushScrollClipPropertiesTo(layer); 42 PushScrollClipPropertiesTo(layer);
41 } 43 }
42 44
43 void ScrollbarLayerImplBase::PushScrollClipPropertiesTo(LayerImpl* layer) { 45 void ScrollbarLayerImplBase::PushScrollClipPropertiesTo(LayerImpl* layer) {
44 DCHECK(layer->ToScrollbarLayer()); 46 DCHECK(layer->ToScrollbarLayer());
45 layer->ToScrollbarLayer()->SetScrollLayerAndClipLayerByIds(ScrollLayerId(), 47 layer->ToScrollbarLayer()->SetScrollLayerAndClipLayerByIds(ScrollLayerId(),
46 ClipLayerId()); 48 ClipLayerId());
47 } 49 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 } 253 }
252 254
253 void ScrollbarLayerImplBase::ScrollbarParametersDidChange(bool on_resize) { 255 void ScrollbarLayerImplBase::ScrollbarParametersDidChange(bool on_resize) {
254 if (!clip_layer_ || !scroll_layer_) 256 if (!clip_layer_ || !scroll_layer_)
255 return; 257 return;
256 258
257 scroll_layer_->SetScrollbarPosition(this, clip_layer_, on_resize); 259 scroll_layer_->SetScrollbarPosition(this, clip_layer_, on_resize);
258 } 260 }
259 261
260 } // namespace cc 262 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/surface_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698