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

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

Issue 2777093005: Repaint overlay scrollbar if resource is disposed. (Closed)
Patch Set: Formatting Created 3 years, 8 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 | « no previous file | cc/layers/scrollbar_layer_unittest.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/painted_overlay_scrollbar_layer.h" 5 #include "cc/layers/painted_overlay_scrollbar_layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 updated |= UpdateProperty(scrollbar_->TrackRect(), &track_rect_); 131 updated |= UpdateProperty(scrollbar_->TrackRect(), &track_rect_);
132 updated |= UpdateProperty(scrollbar_->Location(), &location_); 132 updated |= UpdateProperty(scrollbar_->Location(), &location_);
133 updated |= UpdateProperty(scrollbar_->ThumbThickness(), &thumb_thickness_); 133 updated |= UpdateProperty(scrollbar_->ThumbThickness(), &thumb_thickness_);
134 updated |= UpdateProperty(scrollbar_->ThumbLength(), &thumb_length_); 134 updated |= UpdateProperty(scrollbar_->ThumbLength(), &thumb_length_);
135 updated |= PaintThumbIfNeeded(); 135 updated |= PaintThumbIfNeeded();
136 136
137 return updated; 137 return updated;
138 } 138 }
139 139
140 bool PaintedOverlayScrollbarLayer::PaintThumbIfNeeded() { 140 bool PaintedOverlayScrollbarLayer::PaintThumbIfNeeded() {
141 if (!scrollbar_->NeedsPaintPart(THUMB)) 141 if (!scrollbar_->NeedsPaintPart(THUMB) && thumb_resource_)
142 return false; 142 return false;
143 143
144 gfx::Rect paint_rect = OriginThumbRectForPainting(); 144 gfx::Rect paint_rect = OriginThumbRectForPainting();
145 aperture_ = scrollbar_->NinePatchThumbAperture(); 145 aperture_ = scrollbar_->NinePatchThumbAperture();
146 146
147 DCHECK(!paint_rect.size().IsEmpty()); 147 DCHECK(!paint_rect.size().IsEmpty());
148 DCHECK(paint_rect.origin().IsOrigin()); 148 DCHECK(paint_rect.origin().IsOrigin());
149 149
150 SkBitmap skbitmap; 150 SkBitmap skbitmap;
151 skbitmap.allocN32Pixels(paint_rect.width(), paint_rect.height()); 151 skbitmap.allocN32Pixels(paint_rect.width(), paint_rect.height());
(...skipping 13 matching lines...) Expand all
165 165
166 thumb_resource_ = ScopedUIResource::Create( 166 thumb_resource_ = ScopedUIResource::Create(
167 layer_tree_host()->GetUIResourceManager(), UIResourceBitmap(skbitmap)); 167 layer_tree_host()->GetUIResourceManager(), UIResourceBitmap(skbitmap));
168 168
169 SetNeedsPushProperties(); 169 SetNeedsPushProperties();
170 170
171 return true; 171 return true;
172 } 172 }
173 173
174 } // namespace cc 174 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698