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

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

Issue 1458703010: Mac: Don't repaint scrollbars every frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master2
Patch Set: Sprinkle in some tests Created 5 years 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 BLINK_PLATFORM_EXPORT float trackOpacity() const;
68 BLINK_PLATFORM_EXPORT float thumbOpacity() const;
69
70 BLINK_PLATFORM_EXPORT bool needsPaintTrack() const;
chrishtr 2015/11/23 18:59:42 trackBackgroudNeedsRepaint() thumbNeedsRepaint()
ccameron 2015/11/24 01:12:05 Done.
71 BLINK_PLATFORM_EXPORT bool needsPaintThumb() const;
72
67 #if INSIDE_BLINK 73 #if INSIDE_BLINK
68 BLINK_PLATFORM_EXPORT WebScrollbarThemePainter(ScrollbarTheme*, Scrollbar*, float deviceScaleFactor); 74 BLINK_PLATFORM_EXPORT WebScrollbarThemePainter(ScrollbarTheme*, Scrollbar*, float deviceScaleFactor);
69 #endif 75 #endif
70 76
71 private: 77 private:
72 // The theme is not owned by this class. It is assumed that the theme is a 78 // 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 79 // 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 80 // 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. 81 // from the same thread that it is created on.
76 ScrollbarTheme* m_theme; 82 ScrollbarTheme* m_theme;
77 83
78 // It is assumed that the constructor of this paint object is responsible 84 // 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 85 // 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 86 // scrollbar (and not a WebScrollbar wrapper) due to static_casts for
81 // LayoutScrollbar and pointer-based HashMap lookups for Lion scrollbars. 87 // LayoutScrollbar and pointer-based HashMap lookups for Lion scrollbars.
82 WebPrivatePtr<Scrollbar> m_scrollbar; 88 WebPrivatePtr<Scrollbar> m_scrollbar;
83 89
84 float m_deviceScaleFactor; 90 float m_deviceScaleFactor;
85 }; 91 };
86 92
87 } // namespace blink 93 } // namespace blink
88 94
89 #endif 95 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698