Index: cc/layers/painted_scrollbar_layer.cc |
diff --git a/cc/layers/painted_scrollbar_layer.cc b/cc/layers/painted_scrollbar_layer.cc |
index 7062bc1e9bade7910cde353e5be9697cd9922e80..cfde3ea9f43e4dc962c16869bccd0dc35492db55 100644 |
--- a/cc/layers/painted_scrollbar_layer.cc |
+++ b/cc/layers/painted_scrollbar_layer.cc |
@@ -130,8 +130,12 @@ void PaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { |
if (track_resource_.get()) |
scrollbar_layer->set_track_ui_resource_id(track_resource_->id()); |
+ else |
+ scrollbar_layer->set_track_ui_resource_id(0); |
if (thumb_resource_.get()) |
scrollbar_layer->set_thumb_ui_resource_id(thumb_resource_->id()); |
+ else |
+ scrollbar_layer->set_thumb_ui_resource_id(0); |
scrollbar_layer->set_is_overlay_scrollbar(is_overlay_); |
} |
@@ -206,8 +210,19 @@ bool PaintedScrollbarLayer::Update(ResourceUpdateQueue* queue, |
gfx::Rect scaled_track_rect = ScrollbarLayerRectToContentRect( |
track_layer_rect); |
- if (track_rect_.IsEmpty() || scaled_track_rect.IsEmpty()) |
+ if (track_rect_.IsEmpty() || scaled_track_rect.IsEmpty()) { |
+ if (track_resource_ && thumb_resource_) { |
danakj
2014/09/10 16:15:03
&& seems wrong here, if the track is the only thin
MuVen
2014/09/11 14:07:21
Done.
|
+ track_resource_.reset(); |
+ thumb_resource_.reset(); |
+ SetNeedsPushProperties(); |
+ } |
MuVen
2014/09/10 15:40:58
To make it simple i have added the reset of the UI
|
return false; |
+ } |
+ |
+ if (!has_thumb_ && thumb_resource_) { |
+ thumb_resource_.reset(); |
+ SetNeedsPushProperties(); |
+ } |
{ |
base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_, |