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

Side by Side Diff: cc/blink/scrollbar_impl.cc

Issue 2591863003: Use nine-patch resource for drawing Aura overlay scrollbar thumb. (Closed)
Patch Set: Addressed sadrul@'s feedback Created 3 years, 9 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
OLDNEW
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 float ScrollbarImpl::ThumbOpacity() const { 66 float ScrollbarImpl::ThumbOpacity() const {
67 return painter_.thumbOpacity(); 67 return painter_.thumbOpacity();
68 } 68 }
69 69
70 bool ScrollbarImpl::NeedsPaintPart(cc::ScrollbarPart part) const { 70 bool ScrollbarImpl::NeedsPaintPart(cc::ScrollbarPart part) const {
71 if (part == cc::THUMB) 71 if (part == cc::THUMB)
72 return painter_.thumbNeedsRepaint(); 72 return painter_.thumbNeedsRepaint();
73 return painter_.trackNeedsRepaint(); 73 return painter_.trackNeedsRepaint();
74 } 74 }
75 75
76 bool ScrollbarImpl::UsesNinePatchThumbResource() const {
77 return painter_.usesNinePatchThumbResource();
78 }
79
80 gfx::Size ScrollbarImpl::NinePatchThumbCanvasSize() const {
81 return geometry_->ninePatchThumbCanvasSize(scrollbar_.get());
82 }
83
84 gfx::Rect ScrollbarImpl::NinePatchThumbAperture() const {
85 return geometry_->ninePatchThumbAperture(scrollbar_.get());
86 }
87
76 void ScrollbarImpl::PaintPart(cc::PaintCanvas* canvas, 88 void ScrollbarImpl::PaintPart(cc::PaintCanvas* canvas,
77 cc::ScrollbarPart part, 89 cc::ScrollbarPart part,
78 const gfx::Rect& content_rect) { 90 const gfx::Rect& content_rect) {
79 if (part == cc::THUMB) { 91 if (part == cc::THUMB) {
80 painter_.paintThumb(canvas, content_rect); 92 painter_.paintThumb(canvas, content_rect);
81 return; 93 return;
82 } 94 }
83 95
84 // The following is a simplification of ScrollbarThemeComposite::paint. 96 // The following is a simplification of ScrollbarThemeComposite::paint.
85 painter_.paintScrollbarBackground(canvas, content_rect); 97 painter_.paintScrollbarBackground(canvas, content_rect);
(...skipping 22 matching lines...) Expand all
108 bool thumb_present = geometry_->hasThumb(scrollbar_.get()); 120 bool thumb_present = geometry_->hasThumb(scrollbar_.get());
109 if (thumb_present) { 121 if (thumb_present) {
110 painter_.paintForwardTrackPart(canvas, track_paint_rect); 122 painter_.paintForwardTrackPart(canvas, track_paint_rect);
111 painter_.paintBackTrackPart(canvas, track_paint_rect); 123 painter_.paintBackTrackPart(canvas, track_paint_rect);
112 } 124 }
113 125
114 painter_.paintTickmarks(canvas, track_paint_rect); 126 painter_.paintTickmarks(canvas, track_paint_rect);
115 } 127 }
116 128
117 } // namespace cc_blink 129 } // namespace cc_blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698