| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "core/layout/LayoutScrollbarTheme.h" | 26 #include "core/layout/LayoutScrollbarTheme.h" |
| 27 | 27 |
| 28 #include "core/layout/LayoutScrollbar.h" | 28 #include "core/layout/LayoutScrollbar.h" |
| 29 #include "core/paint/ScrollbarPainter.h" | 29 #include "core/paint/ScrollbarPainter.h" |
| 30 #include "platform/graphics/GraphicsContext.h" | 30 #include "platform/graphics/GraphicsContext.h" |
| 31 #include "platform/graphics/paint/DrawingRecorder.h" | 31 #include "platform/graphics/paint/DrawingRecorder.h" |
| 32 #include "platform/scroll/ScrollbarThemeClient.h" | 32 #include "platform/scroll/Scrollbar.h" |
| 33 #include "wtf/StdLibExtras.h" | 33 #include "wtf/StdLibExtras.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 LayoutScrollbarTheme* LayoutScrollbarTheme::layoutScrollbarTheme() | 37 LayoutScrollbarTheme* LayoutScrollbarTheme::layoutScrollbarTheme() |
| 38 { | 38 { |
| 39 DEFINE_STATIC_LOCAL(LayoutScrollbarTheme, theme, ()); | 39 DEFINE_STATIC_LOCAL(LayoutScrollbarTheme, theme, ()); |
| 40 return &theme; | 40 return &theme; |
| 41 } | 41 } |
| 42 | 42 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 void LayoutScrollbarTheme::paintScrollCorner(GraphicsContext& context, const Dis
playItemClient& displayItemClient, const IntRect& cornerRect) | 113 void LayoutScrollbarTheme::paintScrollCorner(GraphicsContext& context, const Dis
playItemClient& displayItemClient, const IntRect& cornerRect) |
| 114 { | 114 { |
| 115 if (DrawingRecorder::useCachedDrawingIfPossible(context, displayItemClient,
DisplayItem::ScrollbarCorner)) | 115 if (DrawingRecorder::useCachedDrawingIfPossible(context, displayItemClient,
DisplayItem::ScrollbarCorner)) |
| 116 return; | 116 return; |
| 117 | 117 |
| 118 DrawingRecorder recorder(context, displayItemClient, DisplayItem::ScrollbarC
orner, cornerRect); | 118 DrawingRecorder recorder(context, displayItemClient, DisplayItem::ScrollbarC
orner, cornerRect); |
| 119 // FIXME: Implement. | 119 // FIXME: Implement. |
| 120 context.fillRect(cornerRect, Color::white); | 120 context.fillRect(cornerRect, Color::white); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void LayoutScrollbarTheme::paintScrollbarBackground(GraphicsContext& context, co
nst ScrollbarThemeClient& scrollbar) | 123 void LayoutScrollbarTheme::paintScrollbarBackground(GraphicsContext& context, co
nst Scrollbar& scrollbar) |
| 124 { | 124 { |
| 125 ScrollbarPainter(toLayoutScrollbar(scrollbar)).paintPart(context, ScrollbarB
GPart, scrollbar.frameRect()); | 125 ScrollbarPainter(toLayoutScrollbar(scrollbar)).paintPart(context, ScrollbarB
GPart, scrollbar.frameRect()); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void LayoutScrollbarTheme::paintTrackBackground(GraphicsContext& context, const
ScrollbarThemeClient& scrollbar, const IntRect& rect) | 128 void LayoutScrollbarTheme::paintTrackBackground(GraphicsContext& context, const
Scrollbar& scrollbar, const IntRect& rect) |
| 129 { | 129 { |
| 130 ScrollbarPainter(toLayoutScrollbar(scrollbar)).paintPart(context, TrackBGPar
t, rect); | 130 ScrollbarPainter(toLayoutScrollbar(scrollbar)).paintPart(context, TrackBGPar
t, rect); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void LayoutScrollbarTheme::paintTrackPiece(GraphicsContext& context, const Scrol
lbarThemeClient& scrollbar, const IntRect& rect, ScrollbarPart part) | 133 void LayoutScrollbarTheme::paintTrackPiece(GraphicsContext& context, const Scrol
lbar& scrollbar, const IntRect& rect, ScrollbarPart part) |
| 134 { | 134 { |
| 135 ScrollbarPainter(toLayoutScrollbar(scrollbar)).paintPart(context, part, rect
); | 135 ScrollbarPainter(toLayoutScrollbar(scrollbar)).paintPart(context, part, rect
); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void LayoutScrollbarTheme::paintButton(GraphicsContext& context, const Scrollbar
ThemeClient& scrollbar, const IntRect& rect, ScrollbarPart part) | 138 void LayoutScrollbarTheme::paintButton(GraphicsContext& context, const Scrollbar
& scrollbar, const IntRect& rect, ScrollbarPart part) |
| 139 { | 139 { |
| 140 ScrollbarPainter(toLayoutScrollbar(scrollbar)).paintPart(context, part, rect
); | 140 ScrollbarPainter(toLayoutScrollbar(scrollbar)).paintPart(context, part, rect
); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void LayoutScrollbarTheme::paintThumb(GraphicsContext& context, const ScrollbarT
hemeClient& scrollbar, const IntRect& rect) | 143 void LayoutScrollbarTheme::paintThumb(GraphicsContext& context, const Scrollbar&
scrollbar, const IntRect& rect) |
| 144 { | 144 { |
| 145 ScrollbarPainter(toLayoutScrollbar(scrollbar)).paintPart(context, ThumbPart,
rect); | 145 ScrollbarPainter(toLayoutScrollbar(scrollbar)).paintPart(context, ThumbPart,
rect); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void LayoutScrollbarTheme::paintTickmarks(GraphicsContext& context, const Scroll
barThemeClient& scrollbar, const IntRect& rect) | 148 void LayoutScrollbarTheme::paintTickmarks(GraphicsContext& context, const Scroll
bar& scrollbar, const IntRect& rect) |
| 149 { | 149 { |
| 150 ScrollbarTheme::theme().paintTickmarks(context, scrollbar, rect); | 150 ScrollbarTheme::theme().paintTickmarks(context, scrollbar, rect); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace blink | 153 } // namespace blink |
| OLD | NEW |