| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |