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

Side by Side Diff: third_party/WebKit/public/platform/WebScrollbarThemePainter.h

Issue 1430503007: Paint scrollbars at device scale resolution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 /* 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 20 matching lines...) Expand all
31 31
32 namespace blink { 32 namespace blink {
33 33
34 class ScrollbarTheme; 34 class ScrollbarTheme;
35 class Scrollbar; 35 class Scrollbar;
36 class WebScrollbar; 36 class WebScrollbar;
37 struct WebRect; 37 struct WebRect;
38 38
39 class WebScrollbarThemePainter { 39 class WebScrollbarThemePainter {
40 public: 40 public:
41 WebScrollbarThemePainter() : m_theme(0) { } 41 WebScrollbarThemePainter() : m_theme(0), m_deviceScaleFactor(1.0) { }
42 WebScrollbarThemePainter(const WebScrollbarThemePainter& painter) { assign(p ainter); } 42 WebScrollbarThemePainter(const WebScrollbarThemePainter& painter) { assign(p ainter); }
43 virtual ~WebScrollbarThemePainter() 43 virtual ~WebScrollbarThemePainter()
44 { 44 {
45 reset(); 45 reset();
46 } 46 }
47 WebScrollbarThemePainter& operator=(const WebScrollbarThemePainter& painter) 47 WebScrollbarThemePainter& operator=(const WebScrollbarThemePainter& painter)
48 { 48 {
49 assign(painter); 49 assign(painter);
50 return *this; 50 return *this;
51 } 51 }
52 52
53 BLINK_PLATFORM_EXPORT void assign(const WebScrollbarThemePainter&); 53 BLINK_PLATFORM_EXPORT void assign(const WebScrollbarThemePainter&);
54 BLINK_PLATFORM_EXPORT void reset(); 54 BLINK_PLATFORM_EXPORT void reset();
55 55
56 BLINK_PLATFORM_EXPORT void paintScrollbarBackground(WebCanvas*, const WebRec t&); 56 BLINK_PLATFORM_EXPORT void paintScrollbarBackground(WebCanvas*, const WebRec t&);
57 BLINK_PLATFORM_EXPORT void paintTrackBackground(WebCanvas*, const WebRect&); 57 BLINK_PLATFORM_EXPORT void paintTrackBackground(WebCanvas*, const WebRect&);
58 BLINK_PLATFORM_EXPORT void paintBackTrackPart(WebCanvas*, const WebRect&); 58 BLINK_PLATFORM_EXPORT void paintBackTrackPart(WebCanvas*, const WebRect&);
59 BLINK_PLATFORM_EXPORT void paintForwardTrackPart(WebCanvas*, const WebRect&) ; 59 BLINK_PLATFORM_EXPORT void paintForwardTrackPart(WebCanvas*, const WebRect&) ;
60 BLINK_PLATFORM_EXPORT void paintBackButtonStart(WebCanvas*, const WebRect&); 60 BLINK_PLATFORM_EXPORT void paintBackButtonStart(WebCanvas*, const WebRect&);
61 BLINK_PLATFORM_EXPORT void paintBackButtonEnd(WebCanvas*, const WebRect&); 61 BLINK_PLATFORM_EXPORT void paintBackButtonEnd(WebCanvas*, const WebRect&);
62 BLINK_PLATFORM_EXPORT void paintForwardButtonStart(WebCanvas*, const WebRect &); 62 BLINK_PLATFORM_EXPORT void paintForwardButtonStart(WebCanvas*, const WebRect &);
63 BLINK_PLATFORM_EXPORT void paintForwardButtonEnd(WebCanvas*, const WebRect&) ; 63 BLINK_PLATFORM_EXPORT void paintForwardButtonEnd(WebCanvas*, const WebRect&) ;
64 BLINK_PLATFORM_EXPORT void paintTickmarks(WebCanvas*, const WebRect&); 64 BLINK_PLATFORM_EXPORT void paintTickmarks(WebCanvas*, const WebRect&);
65 BLINK_PLATFORM_EXPORT void paintThumb(WebCanvas*, const WebRect&); 65 BLINK_PLATFORM_EXPORT void paintThumb(WebCanvas*, const WebRect&);
66 66
67 #if INSIDE_BLINK 67 #if INSIDE_BLINK
68 BLINK_PLATFORM_EXPORT WebScrollbarThemePainter(ScrollbarTheme*, Scrollbar*); 68 BLINK_PLATFORM_EXPORT WebScrollbarThemePainter(ScrollbarTheme*, Scrollbar*, float deviceScaleFactor);
69 #endif 69 #endif
70 70
71 private: 71 private:
72 // The theme is not owned by this class. It is assumed that the theme is a 72 // The theme is not owned by this class. It is assumed that the theme is a
73 // static pointer and its lifetime is essentially infinite. The functions 73 // static pointer and its lifetime is essentially infinite. The functions
74 // called from the painter may not be thread-safe, so all calls must be made 74 // called from the painter may not be thread-safe, so all calls must be made
75 // from the same thread that it is created on. 75 // from the same thread that it is created on.
76 ScrollbarTheme* m_theme; 76 ScrollbarTheme* m_theme;
77 77
78 // It is assumed that the constructor of this paint object is responsible 78 // It is assumed that the constructor of this paint object is responsible
79 // for the lifetime of this scrollbar. The painter has to use the real 79 // for the lifetime of this scrollbar. The painter has to use the real
80 // scrollbar (and not a WebScrollbar wrapper) due to static_casts for 80 // scrollbar (and not a WebScrollbar wrapper) due to static_casts for
81 // LayoutScrollbar and pointer-based HashMap lookups for Lion scrollbars. 81 // LayoutScrollbar and pointer-based HashMap lookups for Lion scrollbars.
82 WebPrivatePtr<Scrollbar> m_scrollbar; 82 WebPrivatePtr<Scrollbar> m_scrollbar;
83
84 float m_deviceScaleFactor;
83 }; 85 };
84 86
85 } // namespace blink 87 } // namespace blink
86 88
87 #endif 89 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698