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

Side by Side Diff: webkit/renderer/compositor_bindings/scrollbar_impl.cc

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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 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 "webkit/renderer/compositor_bindings/scrollbar_impl.h" 5 #include "webkit/renderer/compositor_bindings/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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 if (scrollbar_->orientation() == WebScrollbar::Horizontal) 56 if (scrollbar_->orientation() == WebScrollbar::Horizontal)
57 return thumb_rect.width(); 57 return thumb_rect.width();
58 return thumb_rect.height(); 58 return thumb_rect.height();
59 } 59 }
60 60
61 gfx::Rect ScrollbarImpl::TrackRect() const { 61 gfx::Rect ScrollbarImpl::TrackRect() const {
62 return geometry_->trackRect(scrollbar_.get()); 62 return geometry_->trackRect(scrollbar_.get());
63 } 63 }
64 64
65 void ScrollbarImpl::PaintPart( 65 void ScrollbarImpl::PaintPart(
66 SkCanvas* canvas, cc::ScrollbarPart part, gfx::Rect content_rect) { 66 SkCanvas* canvas, cc::ScrollbarPart part,
67 const gfx::Rect& content_rect) {
67 if (part == cc::THUMB) { 68 if (part == cc::THUMB) {
68 painter_.paintThumb(canvas, content_rect); 69 painter_.paintThumb(canvas, content_rect);
69 return; 70 return;
70 } 71 }
71 72
72 // The following is a simplification of ScrollbarThemeComposite::paint. 73 // The following is a simplification of ScrollbarThemeComposite::paint.
73 painter_.paintScrollbarBackground(canvas, content_rect); 74 painter_.paintScrollbarBackground(canvas, content_rect);
74 75
75 if (geometry_->hasButtons(scrollbar_.get())) { 76 if (geometry_->hasButtons(scrollbar_.get())) {
76 gfx::Rect back_button_start_paint_rect = 77 gfx::Rect back_button_start_paint_rect =
(...skipping 20 matching lines...) Expand all
97 bool thumb_present = geometry_->hasThumb(scrollbar_.get()); 98 bool thumb_present = geometry_->hasThumb(scrollbar_.get());
98 if (thumb_present) { 99 if (thumb_present) {
99 painter_.paintForwardTrackPart(canvas, track_paint_rect); 100 painter_.paintForwardTrackPart(canvas, track_paint_rect);
100 painter_.paintBackTrackPart(canvas, track_paint_rect); 101 painter_.paintBackTrackPart(canvas, track_paint_rect);
101 } 102 }
102 103
103 painter_.paintTickmarks(canvas, track_paint_rect); 104 painter_.paintTickmarks(canvas, track_paint_rect);
104 } 105 }
105 106
106 } // namespace webkit 107 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/renderer/compositor_bindings/scrollbar_impl.h ('k') | webkit/renderer/compositor_bindings/web_content_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698