OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
13 * | 13 * |
14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "public/platform/WebScrollbarThemePainter.h" | 26 #include "public/platform/WebScrollbarThemePainter.h" |
27 | 27 |
28 #include "platform/graphics/GraphicsContext.h" | 28 #include "platform/graphics/GraphicsContext.h" |
| 29 #include "platform/graphics/GraphicsScreen.h" |
29 #include "platform/graphics/paint/SkPictureBuilder.h" | 30 #include "platform/graphics/paint/SkPictureBuilder.h" |
30 #include "platform/scroll/Scrollbar.h" | 31 #include "platform/scroll/Scrollbar.h" |
31 #include "platform/scroll/ScrollbarTheme.h" | 32 #include "platform/scroll/ScrollbarTheme.h" |
32 #include "public/platform/WebRect.h" | 33 #include "public/platform/WebRect.h" |
33 #include "third_party/skia/include/core/SkCanvas.h" | 34 #include "third_party/skia/include/core/SkCanvas.h" |
34 | 35 |
35 namespace blink { | 36 namespace blink { |
36 | 37 |
37 void WebScrollbarThemePainter::assign(const WebScrollbarThemePainter& painter) | 38 void WebScrollbarThemePainter::assign(const WebScrollbarThemePainter& painter) |
38 { | 39 { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 { | 120 { |
120 IntRect intRect(rect); | 121 IntRect intRect(rect); |
121 SkPictureBuilder pictureBuilder(intRect); | 122 SkPictureBuilder pictureBuilder(intRect); |
122 pictureBuilder.context().setDeviceScaleFactor(m_deviceScaleFactor); | 123 pictureBuilder.context().setDeviceScaleFactor(m_deviceScaleFactor); |
123 m_theme->paintButton(pictureBuilder.context(), *m_scrollbar, intRect, Forwar
dButtonEndPart); | 124 m_theme->paintButton(pictureBuilder.context(), *m_scrollbar, intRect, Forwar
dButtonEndPart); |
124 pictureBuilder.endRecording()->playback(canvas); | 125 pictureBuilder.endRecording()->playback(canvas); |
125 } | 126 } |
126 | 127 |
127 void WebScrollbarThemePainter::paintTickmarks(WebCanvas* canvas, const WebRect&
rect) | 128 void WebScrollbarThemePainter::paintTickmarks(WebCanvas* canvas, const WebRect&
rect) |
128 { | 129 { |
| 130 WillPaintForDevice device(m_scrollbar->screenId()); |
| 131 |
129 IntRect intRect(rect); | 132 IntRect intRect(rect); |
130 SkPictureBuilder pictureBuilder(intRect); | 133 SkPictureBuilder pictureBuilder(intRect); |
131 pictureBuilder.context().setDeviceScaleFactor(m_deviceScaleFactor); | 134 pictureBuilder.context().setDeviceScaleFactor(m_deviceScaleFactor); |
132 m_theme->paintTickmarks(pictureBuilder.context(), *m_scrollbar, intRect); | 135 m_theme->paintTickmarks(pictureBuilder.context(), *m_scrollbar, intRect); |
133 pictureBuilder.endRecording()->playback(canvas); | 136 pictureBuilder.endRecording()->playback(canvas); |
134 } | 137 } |
135 | 138 |
136 void WebScrollbarThemePainter::paintThumb(WebCanvas* canvas, const WebRect& rect
) | 139 void WebScrollbarThemePainter::paintThumb(WebCanvas* canvas, const WebRect& rect
) |
137 { | 140 { |
138 IntRect intRect(rect); | 141 IntRect intRect(rect); |
(...skipping 21 matching lines...) Expand all Loading... |
160 { | 163 { |
161 return m_scrollbar->trackNeedsRepaint(); | 164 return m_scrollbar->trackNeedsRepaint(); |
162 } | 165 } |
163 | 166 |
164 bool WebScrollbarThemePainter::thumbNeedsRepaint() const | 167 bool WebScrollbarThemePainter::thumbNeedsRepaint() const |
165 { | 168 { |
166 return m_scrollbar->thumbNeedsRepaint(); | 169 return m_scrollbar->thumbNeedsRepaint(); |
167 } | 170 } |
168 | 171 |
169 } // namespace blink | 172 } // namespace blink |
OLD | NEW |