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

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

Issue 2128633002: cc: Set up the framework to restrict access to Layer internals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move out the inner struct. Created 4 years, 5 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/layer_unittest.cc ('k') | cc/layers/texture_layer.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/painted_scrollbar_layer.h" 5 #include "cc/layers/painted_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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 238 }
239 return updated; 239 return updated;
240 } 240 }
241 241
242 if (!has_thumb_ && thumb_resource_) { 242 if (!has_thumb_ && thumb_resource_) {
243 thumb_resource_ = nullptr; 243 thumb_resource_ = nullptr;
244 SetNeedsPushProperties(); 244 SetNeedsPushProperties();
245 updated = true; 245 updated = true;
246 } 246 }
247 247
248 if (update_rect_.IsEmpty() && track_resource_) 248 if (update_rect().IsEmpty() && track_resource_)
249 return updated; 249 return updated;
250 250
251 if (!track_resource_ || scrollbar_->NeedsPaintPart(TRACK)) { 251 if (!track_resource_ || scrollbar_->NeedsPaintPart(TRACK)) {
252 track_resource_ = ScopedUIResource::Create( 252 track_resource_ = ScopedUIResource::Create(
253 layer_tree_host(), 253 layer_tree_host(),
254 RasterizeScrollbarPart(track_layer_rect, scaled_track_rect, TRACK)); 254 RasterizeScrollbarPart(track_layer_rect, scaled_track_rect, TRACK));
255 } 255 }
256 256
257 gfx::Rect thumb_layer_rect = OriginThumbRect(); 257 gfx::Rect thumb_layer_rect = OriginThumbRect();
258 gfx::Rect scaled_thumb_rect = 258 gfx::Rect scaled_thumb_rect =
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 scrollbar_->PaintPart(&skcanvas, part, layer_rect); 305 scrollbar_->PaintPart(&skcanvas, part, layer_rect);
306 // Make sure that the pixels are no longer mutable to unavoid unnecessary 306 // Make sure that the pixels are no longer mutable to unavoid unnecessary
307 // allocation and copying. 307 // allocation and copying.
308 skbitmap.setImmutable(); 308 skbitmap.setImmutable();
309 309
310 return UIResourceBitmap(skbitmap); 310 return UIResourceBitmap(skbitmap);
311 } 311 }
312 312
313 } // namespace cc 313 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_unittest.cc ('k') | cc/layers/texture_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698