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/input/pinch_zoom_scrollbar_painter.h" | 5 #include "cc/input/pinch_zoom_scrollbar_painter.h" |
6 | 6 |
7 #include "third_party/skia/include/core/SkCanvas.h" | 7 #include "third_party/skia/include/core/SkCanvas.h" |
8 #include "ui/gfx/rect.h" | 8 #include "ui/gfx/rect.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 SkCanvas* canvas, | 45 SkCanvas* canvas, |
46 gfx::Rect rect) { | 46 gfx::Rect rect) { |
47 } | 47 } |
48 | 48 |
49 void PinchZoomScrollbarPainter::PaintForwardButtonEnd( | 49 void PinchZoomScrollbarPainter::PaintForwardButtonEnd( |
50 SkCanvas* canvas, | 50 SkCanvas* canvas, |
51 gfx::Rect rect) { | 51 gfx::Rect rect) { |
52 } | 52 } |
53 | 53 |
54 void PinchZoomScrollbarPainter::PaintTickmarks( | 54 void PinchZoomScrollbarPainter::PaintTickmarks( |
55 SkCanvas* canvas, | 55 SkCanvas* canvas, |
56 gfx::Rect rect) { | 56 gfx::Rect rect) { |
57 } | 57 } |
58 | 58 |
59 void PinchZoomScrollbarPainter::PaintThumb( | 59 void PinchZoomScrollbarPainter::PaintThumb( |
60 SkCanvas* canvas, | 60 SkCanvas* canvas, |
61 gfx::Rect thumb_rect) { | 61 gfx::Rect thumb_rect) { |
62 canvas->clear(SkColorSetARGB(0, 0, 0, 0)); | 62 canvas->clear(SkColorSetARGB(0, 0, 0, 0)); |
63 SkPaint paint; | 63 SkPaint paint; |
64 | 64 |
65 // TODO(wjmaclean): currently the pinch-zoom overlay scrollbars are | 65 // TODO(wjmaclean): currently the pinch-zoom overlay scrollbars are |
66 // drawn as grey, but need to check this with UX design. | 66 // drawn as grey, but need to check this with UX design. |
67 paint.setColor(SkColorSetARGB(128, 32, 32, 32)); | 67 paint.setColor(SkColorSetARGB(128, 32, 32, 32)); |
68 SkScalar border = 2; | 68 SkScalar border = 2; |
69 SkScalar corner_radius = 2; | 69 SkScalar corner_radius = 2; |
70 SkRect rect = SkRect::MakeXYWH(border, border, | 70 SkRect rect = SkRect::MakeXYWH(border, border, |
71 thumb_rect.width() - 2 * border, | 71 thumb_rect.width() - 2 * border, |
72 thumb_rect.height() - 2 * border); | 72 thumb_rect.height() - 2 * border); |
73 canvas->drawRoundRect(rect, corner_radius, corner_radius, paint); | 73 canvas->drawRoundRect(rect, corner_radius, corner_radius, paint); |
74 } | 74 } |
75 | 75 |
76 } // namespace cc | 76 } // namespace cc |
OLD | NEW |