OLD | NEW |
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_BASE_NATIVE_THEME_NATIVE_THEME_WIN_H_ | 5 #ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_WIN_H_ |
6 #define UI_BASE_NATIVE_THEME_NATIVE_THEME_WIN_H_ | 6 #define UI_BASE_NATIVE_THEME_NATIVE_THEME_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // A wrapper class for working with custom XP/Vista themes provided in | 9 // A wrapper class for working with custom XP/Vista themes provided in |
10 // uxtheme.dll. This is a singleton class that can be grabbed using | 10 // uxtheme.dll. This is a singleton class that can be grabbed using |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 virtual gfx::Size GetPartSize(Part part, | 105 virtual gfx::Size GetPartSize(Part part, |
106 State state, | 106 State state, |
107 const ExtraParams& extra) const OVERRIDE; | 107 const ExtraParams& extra) const OVERRIDE; |
108 virtual void Paint(SkCanvas* canvas, | 108 virtual void Paint(SkCanvas* canvas, |
109 Part part, | 109 Part part, |
110 State state, | 110 State state, |
111 const gfx::Rect& rect, | 111 const gfx::Rect& rect, |
112 const ExtraParams& extra) const OVERRIDE; | 112 const ExtraParams& extra) const OVERRIDE; |
113 virtual SkColor GetSystemColor(ColorId color_id) const OVERRIDE; | 113 virtual SkColor GetSystemColor(ColorId color_id) const OVERRIDE; |
114 | 114 |
115 void PaintToNonPlatformCanvas(SkCanvas* canvas, | 115 // Paint directly to canvas' HDC. |
116 Part part, | 116 void PaintDirect(SkCanvas* canvas, |
117 State state, | 117 Part part, |
118 const gfx::Rect& rect, | 118 State state, |
119 const ExtraParams& extra) const; | 119 const gfx::Rect& rect, |
| 120 const ExtraParams& extra) const; |
| 121 |
| 122 // Create a temporary HDC, paint to that, clean up the alpha values in the |
| 123 // temporary HDC, and then blit the result to canvas. This is to work around |
| 124 // the fact that Windows XP and some classic themes give bogus alpha values. |
| 125 void PaintIndirect(SkCanvas* canvas, |
| 126 Part part, |
| 127 State state, |
| 128 const gfx::Rect& rect, |
| 129 const ExtraParams& extra) const; |
120 | 130 |
121 HRESULT GetThemePartSize(ThemeName themeName, | 131 HRESULT GetThemePartSize(ThemeName themeName, |
122 HDC hdc, | 132 HDC hdc, |
123 int part_id, | 133 int part_id, |
124 int state_id, | 134 int state_id, |
125 RECT* rect, | 135 RECT* rect, |
126 int ts, | 136 int ts, |
127 SIZE* size) const; | 137 SIZE* size) const; |
128 | 138 |
129 HRESULT PaintButton(HDC hdc, | 139 HRESULT PaintButton(HDC hdc, |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 | 332 |
323 // A cache of open theme handles. | 333 // A cache of open theme handles. |
324 mutable HANDLE theme_handles_[LAST]; | 334 mutable HANDLE theme_handles_[LAST]; |
325 | 335 |
326 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); | 336 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); |
327 }; | 337 }; |
328 | 338 |
329 } // namespace ui | 339 } // namespace ui |
330 | 340 |
331 #endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_WIN_H_ | 341 #endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_WIN_H_ |
OLD | NEW |