| 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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "cc/layers/painted_scrollbar_layer_impl.h" | 10 #include "cc/layers/painted_scrollbar_layer_impl.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 UpdateProperty(scrollbar_->Location(), &location_); | 195 UpdateProperty(scrollbar_->Location(), &location_); |
| 196 UpdateProperty(scrollbar_->IsOverlay(), &is_overlay_); | 196 UpdateProperty(scrollbar_->IsOverlay(), &is_overlay_); |
| 197 UpdateProperty(scrollbar_->HasThumb(), &has_thumb_); | 197 UpdateProperty(scrollbar_->HasThumb(), &has_thumb_); |
| 198 if (has_thumb_) { | 198 if (has_thumb_) { |
| 199 UpdateProperty(scrollbar_->ThumbThickness(), &thumb_thickness_); | 199 UpdateProperty(scrollbar_->ThumbThickness(), &thumb_thickness_); |
| 200 UpdateProperty(scrollbar_->ThumbLength(), &thumb_length_); | 200 UpdateProperty(scrollbar_->ThumbLength(), &thumb_length_); |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 bool PaintedScrollbarLayer::Update(ResourceUpdateQueue* queue, | 204 bool PaintedScrollbarLayer::Update(ResourceUpdateQueue* queue, |
| 205 const OcclusionTracker* occlusion) { | 205 const OcclusionTracker<Layer>* occlusion) { |
| 206 UpdateThumbAndTrackGeometry(); | 206 UpdateThumbAndTrackGeometry(); |
| 207 | 207 |
| 208 gfx::Rect track_layer_rect = gfx::Rect(location_, bounds()); | 208 gfx::Rect track_layer_rect = gfx::Rect(location_, bounds()); |
| 209 gfx::Rect scaled_track_rect = ScrollbarLayerRectToContentRect( | 209 gfx::Rect scaled_track_rect = ScrollbarLayerRectToContentRect( |
| 210 track_layer_rect); | 210 track_layer_rect); |
| 211 | 211 |
| 212 if (track_rect_.IsEmpty() || scaled_track_rect.IsEmpty()) | 212 if (track_rect_.IsEmpty() || scaled_track_rect.IsEmpty()) |
| 213 return false; | 213 return false; |
| 214 | 214 |
| 215 { | 215 { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 273 |
| 274 scrollbar_->PaintPart(&skcanvas, part, layer_rect); | 274 scrollbar_->PaintPart(&skcanvas, part, layer_rect); |
| 275 // Make sure that the pixels are no longer mutable to unavoid unnecessary | 275 // Make sure that the pixels are no longer mutable to unavoid unnecessary |
| 276 // allocation and copying. | 276 // allocation and copying. |
| 277 skbitmap.setImmutable(); | 277 skbitmap.setImmutable(); |
| 278 | 278 |
| 279 return UIResourceBitmap(skbitmap); | 279 return UIResourceBitmap(skbitmap); |
| 280 } | 280 } |
| 281 | 281 |
| 282 } // namespace cc | 282 } // namespace cc |
| OLD | NEW |