| 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 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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 #ifndef WebScrollbarThemePainter_h | 26 #ifndef WebScrollbarThemePainter_h |
| 27 #define WebScrollbarThemePainter_h | 27 #define WebScrollbarThemePainter_h |
| 28 | 28 |
| 29 #include "public/platform/WebCanvas.h" | 29 #include "public/platform/WebCanvas.h" |
| 30 #include "public/platform/WebPrivatePtr.h" | 30 #include "public/platform/WebPrivatePtr.h" |
| 31 #include "public/platform/WebRect.h" |
| 32 #include "public/platform/WebSize.h" |
| 31 | 33 |
| 32 namespace blink { | 34 namespace blink { |
| 33 | 35 |
| 34 class ScrollbarTheme; | 36 class ScrollbarTheme; |
| 35 class Scrollbar; | 37 class Scrollbar; |
| 36 class WebScrollbar; | 38 class WebScrollbar; |
| 37 struct WebRect; | |
| 38 | 39 |
| 39 class WebScrollbarThemePainter { | 40 class WebScrollbarThemePainter { |
| 40 public: | 41 public: |
| 41 WebScrollbarThemePainter() : m_theme(0), m_deviceScaleFactor(1.0) {} | 42 WebScrollbarThemePainter() : m_theme(0), m_deviceScaleFactor(1.0) {} |
| 42 WebScrollbarThemePainter(const WebScrollbarThemePainter& painter) { | 43 WebScrollbarThemePainter(const WebScrollbarThemePainter& painter) { |
| 43 assign(painter); | 44 assign(painter); |
| 44 } | 45 } |
| 45 virtual ~WebScrollbarThemePainter() { reset(); } | 46 virtual ~WebScrollbarThemePainter() { reset(); } |
| 46 WebScrollbarThemePainter& operator=(const WebScrollbarThemePainter& painter) { | 47 WebScrollbarThemePainter& operator=(const WebScrollbarThemePainter& painter) { |
| 47 assign(painter); | 48 assign(painter); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 64 BLINK_PLATFORM_EXPORT void paintTickmarks(WebCanvas*, const WebRect&); | 65 BLINK_PLATFORM_EXPORT void paintTickmarks(WebCanvas*, const WebRect&); |
| 65 BLINK_PLATFORM_EXPORT void paintThumb(WebCanvas*, const WebRect&); | 66 BLINK_PLATFORM_EXPORT void paintThumb(WebCanvas*, const WebRect&); |
| 66 | 67 |
| 67 // This opacity is applied on top of the content that is painted for the | 68 // This opacity is applied on top of the content that is painted for the |
| 68 // thumb. | 69 // thumb. |
| 69 BLINK_PLATFORM_EXPORT float thumbOpacity() const; | 70 BLINK_PLATFORM_EXPORT float thumbOpacity() const; |
| 70 | 71 |
| 71 BLINK_PLATFORM_EXPORT bool trackNeedsRepaint() const; | 72 BLINK_PLATFORM_EXPORT bool trackNeedsRepaint() const; |
| 72 BLINK_PLATFORM_EXPORT bool thumbNeedsRepaint() const; | 73 BLINK_PLATFORM_EXPORT bool thumbNeedsRepaint() const; |
| 73 | 74 |
| 75 BLINK_PLATFORM_EXPORT bool usesNinePatchThumbResource() const; |
| 76 |
| 74 #if INSIDE_BLINK | 77 #if INSIDE_BLINK |
| 75 BLINK_PLATFORM_EXPORT WebScrollbarThemePainter(ScrollbarTheme&, | 78 BLINK_PLATFORM_EXPORT WebScrollbarThemePainter(ScrollbarTheme&, |
| 76 Scrollbar&, | 79 Scrollbar&, |
| 77 float deviceScaleFactor); | 80 float deviceScaleFactor); |
| 78 #endif | 81 #endif |
| 79 | 82 |
| 80 private: | 83 private: |
| 81 // The theme is not owned by this class. It is assumed that the theme is a | 84 // The theme is not owned by this class. It is assumed that the theme is a |
| 82 // static pointer and its lifetime is essentially infinite. The functions | 85 // static pointer and its lifetime is essentially infinite. The functions |
| 83 // called from the painter may not be thread-safe, so all calls must be made | 86 // called from the painter may not be thread-safe, so all calls must be made |
| 84 // from the same thread that it is created on. | 87 // from the same thread that it is created on. |
| 85 ScrollbarTheme* m_theme; | 88 ScrollbarTheme* m_theme; |
| 86 | 89 |
| 87 // It is assumed that the constructor of this paint object is responsible | 90 // It is assumed that the constructor of this paint object is responsible |
| 88 // for the lifetime of this scrollbar. The painter has to use the real | 91 // for the lifetime of this scrollbar. The painter has to use the real |
| 89 // scrollbar (and not a WebScrollbar wrapper) due to static_casts for | 92 // scrollbar (and not a WebScrollbar wrapper) due to static_casts for |
| 90 // LayoutScrollbar and pointer-based HashMap lookups for Lion scrollbars. | 93 // LayoutScrollbar and pointer-based HashMap lookups for Lion scrollbars. |
| 91 WebPrivatePtr<Scrollbar> m_scrollbar; | 94 WebPrivatePtr<Scrollbar> m_scrollbar; |
| 92 | 95 |
| 93 float m_deviceScaleFactor; | 96 float m_deviceScaleFactor; |
| 94 }; | 97 }; |
| 95 | 98 |
| 96 } // namespace blink | 99 } // namespace blink |
| 97 | 100 |
| 98 #endif | 101 #endif |
| OLD | NEW |