Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/blink/scrollbar_impl.h" | 5 #include "cc/blink/scrollbar_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "third_party/WebKit/public/platform/WebScrollbar.h" | 8 #include "third_party/WebKit/public/platform/WebScrollbar.h" |
| 9 #include "third_party/WebKit/public/platform/WebScrollbarThemeGeometry.h" | 9 #include "third_party/WebKit/public/platform/WebScrollbarThemeGeometry.h" |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 gfx::Rect thumb_rect = geometry_->thumbRect(scrollbar_.get()); | 57 gfx::Rect thumb_rect = geometry_->thumbRect(scrollbar_.get()); |
| 58 if (scrollbar_->orientation() == WebScrollbar::Horizontal) | 58 if (scrollbar_->orientation() == WebScrollbar::Horizontal) |
| 59 return thumb_rect.width(); | 59 return thumb_rect.width(); |
| 60 return thumb_rect.height(); | 60 return thumb_rect.height(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 gfx::Rect ScrollbarImpl::TrackRect() const { | 63 gfx::Rect ScrollbarImpl::TrackRect() const { |
| 64 return geometry_->trackRect(scrollbar_.get()); | 64 return geometry_->trackRect(scrollbar_.get()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 float ScrollbarImpl::ThumbOpacity() const { | |
| 68 return painter_.thumbOpacity(); | |
| 69 } | |
| 70 | |
| 71 float ScrollbarImpl::TrackOpacity() const { | |
| 72 return painter_.trackOpacity(); | |
| 73 } | |
| 74 | |
| 75 bool ScrollbarImpl::NeedsPaintPart(cc::ScrollbarPart part) const { | |
| 76 if (part == cc::THUMB) | |
|
enne (OOO)
2015/11/23 19:05:24
This should just return false and maybe also NOTRE
ccameron
2015/11/24 01:12:04
Mmh, this is called on the main thread -- the "Imp
enne (OOO)
2015/11/24 17:59:18
<_<
| |
| 77 return painter_.needsPaintThumb(); | |
| 78 return painter_.needsPaintTrack(); | |
| 79 } | |
| 80 | |
| 67 void ScrollbarImpl::PaintPart(SkCanvas* canvas, | 81 void ScrollbarImpl::PaintPart(SkCanvas* canvas, |
| 68 cc::ScrollbarPart part, | 82 cc::ScrollbarPart part, |
| 69 const gfx::Rect& content_rect) { | 83 const gfx::Rect& content_rect) { |
| 70 if (part == cc::THUMB) { | 84 if (part == cc::THUMB) { |
| 71 painter_.paintThumb(canvas, content_rect); | 85 painter_.paintThumb(canvas, content_rect); |
| 72 return; | 86 return; |
| 73 } | 87 } |
| 74 | 88 |
| 75 // The following is a simplification of ScrollbarThemeComposite::paint. | 89 // The following is a simplification of ScrollbarThemeComposite::paint. |
| 76 painter_.paintScrollbarBackground(canvas, content_rect); | 90 painter_.paintScrollbarBackground(canvas, content_rect); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 99 bool thumb_present = geometry_->hasThumb(scrollbar_.get()); | 113 bool thumb_present = geometry_->hasThumb(scrollbar_.get()); |
| 100 if (thumb_present) { | 114 if (thumb_present) { |
| 101 painter_.paintForwardTrackPart(canvas, track_paint_rect); | 115 painter_.paintForwardTrackPart(canvas, track_paint_rect); |
| 102 painter_.paintBackTrackPart(canvas, track_paint_rect); | 116 painter_.paintBackTrackPart(canvas, track_paint_rect); |
| 103 } | 117 } |
| 104 | 118 |
| 105 painter_.paintTickmarks(canvas, track_paint_rect); | 119 painter_.paintTickmarks(canvas, track_paint_rect); |
| 106 } | 120 } |
| 107 | 121 |
| 108 } // namespace cc_blink | 122 } // namespace cc_blink |
| OLD | NEW |