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

Side by Side Diff: ui/native_theme/native_theme_win.h

Issue 2090003003: Remove NativeThemeWin::PaintIndirect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch to default: Created 4 years, 5 months 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
« no previous file with comments | « no previous file | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ 5 #ifndef UI_NATIVE_THEME_NATIVE_THEME_WIN_H_
6 #define UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ 6 #define UI_NATIVE_THEME_NATIVE_THEME_WIN_H_
7 7
8 // A wrapper class for working with custom XP/Vista themes provided in 8 // A wrapper class for working with custom XP/Vista themes provided in
9 // uxtheme.dll. This is a singleton class that can be grabbed using 9 // uxtheme.dll. This is a singleton class that can be grabbed using
10 // NativeThemeWin::instance(). 10 // NativeThemeWin::instance().
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void OnSysColorChange() override; 123 void OnSysColorChange() override;
124 124
125 // Update the locally cached set of system colors. 125 // Update the locally cached set of system colors.
126 void UpdateSystemColors(); 126 void UpdateSystemColors();
127 127
128 // Painting functions that paint to SkCanvas. 128 // Painting functions that paint to SkCanvas.
129 void PaintMenuSeparator(SkCanvas* canvas, const gfx::Rect& rect) const; 129 void PaintMenuSeparator(SkCanvas* canvas, const gfx::Rect& rect) const;
130 void PaintMenuGutter(SkCanvas* canvas, const gfx::Rect& rect) const; 130 void PaintMenuGutter(SkCanvas* canvas, const gfx::Rect& rect) const;
131 void PaintMenuBackground(SkCanvas* canvas, const gfx::Rect& rect) const; 131 void PaintMenuBackground(SkCanvas* canvas, const gfx::Rect& rect) const;
132 132
133 // Paint directly to canvas' HDC.
134 void PaintDirect(SkCanvas* canvas,
135 Part part,
136 State state,
137 const gfx::Rect& rect,
138 const ExtraParams& extra) const;
139
140 // Create a temporary HDC, paint to that, clean up the alpha values in the
141 // temporary HDC, and then blit the result to canvas. This is to work around
142 // the fact that Windows XP and some classic themes give bogus alpha values.
143 void PaintIndirect(SkCanvas* canvas,
144 Part part,
145 State state,
146 const gfx::Rect& rect,
147 const ExtraParams& extra) const;
148
149 HRESULT GetThemePartSize(ThemeName themeName, 133 HRESULT GetThemePartSize(ThemeName themeName,
150 HDC hdc, 134 HDC hdc,
151 int part_id, 135 int part_id,
152 int state_id, 136 int state_id,
153 RECT* rect, 137 RECT* rect,
154 int ts, 138 int ts,
155 SIZE* size) const; 139 SIZE* size) const;
156 140
157 HRESULT PaintButton(HDC hdc, 141 HRESULT PaintButton(HDC hdc,
158 State state, 142 State state,
159 const ButtonExtraParams& extra, 143 const ButtonExtraParams& extra,
160 int part_id, 144 int part_id,
161 int state_id, 145 int state_id,
162 RECT* rect) const; 146 RECT* rect) const;
163 147
164 HRESULT PaintMenuSeparator(HDC hdc,
165 const gfx::Rect& rect) const;
166
167 HRESULT PaintMenuGutter(HDC hdc, const gfx::Rect& rect) const;
168
169 // |arrow_direction| determines whether the arrow is pointing to the left or 148 // |arrow_direction| determines whether the arrow is pointing to the left or
170 // to the right. In RTL locales, sub-menus open from right to left and 149 // to the right. In RTL locales, sub-menus open from right to left and
171 // therefore the menu arrow should point to the left and not to the right. 150 // therefore the menu arrow should point to the left and not to the right.
172 HRESULT PaintMenuArrow(HDC hdc, 151 HRESULT PaintMenuArrow(HDC hdc,
173 State state, 152 State state,
174 const gfx::Rect& rect, 153 const gfx::Rect& rect,
175 const MenuArrowExtraParams& extra) const; 154 const MenuArrowExtraParams& extra) const;
176 155
177 HRESULT PaintMenuBackground(HDC hdc, const gfx::Rect& rect) const;
178
179 HRESULT PaintMenuCheck(HDC hdc, 156 HRESULT PaintMenuCheck(HDC hdc,
180 State state, 157 State state,
181 const gfx::Rect& rect, 158 const gfx::Rect& rect,
182 const MenuCheckExtraParams& extra) const; 159 const MenuCheckExtraParams& extra) const;
183 160
184 HRESULT PaintMenuCheckBackground(HDC hdc, 161 HRESULT PaintMenuCheckBackground(HDC hdc,
185 State state, 162 State state,
186 const gfx::Rect& rect) const; 163 const gfx::Rect& rect) const;
187 164
188 HRESULT PaintMenuItemBackground(HDC hdc,
189 State state,
190 const gfx::Rect& rect,
191 const MenuItemExtraParams& extra) const;
192
193 HRESULT PaintPushButton(HDC hdc, 165 HRESULT PaintPushButton(HDC hdc,
194 Part part, 166 Part part,
195 State state, 167 State state,
196 const gfx::Rect& rect, 168 const gfx::Rect& rect,
197 const ButtonExtraParams& extra) const; 169 const ButtonExtraParams& extra) const;
198 170
199 HRESULT PaintRadioButton(HDC hdc, 171 HRESULT PaintRadioButton(HDC hdc,
200 Part part, 172 Part part,
201 State state, 173 State state,
202 const gfx::Rect& rect, 174 const gfx::Rect& rect,
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 341
370 // Is |is_using_high_contrast_| valid? 342 // Is |is_using_high_contrast_| valid?
371 mutable bool is_using_high_contrast_valid_; 343 mutable bool is_using_high_contrast_valid_;
372 344
373 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); 345 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin);
374 }; 346 };
375 347
376 } // namespace ui 348 } // namespace ui
377 349
378 #endif // UI_NATIVE_THEME_NATIVE_THEME_WIN_H_ 350 #endif // UI_NATIVE_THEME_NATIVE_THEME_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698