OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "ui/gfx/native_theme_win.h" | 5 #include "ui/gfx/native_theme_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <uxtheme.h> | 8 #include <uxtheme.h> |
9 #include <vsstyle.h> | 9 #include <vsstyle.h> |
10 #include <vssym32.h> | 10 #include <vssym32.h> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 ReleaseDC(NULL, hdc); | 125 ReleaseDC(NULL, hdc); |
126 | 126 |
127 return SUCCEEDED(hr) ? Size(size.cx, size.cy) : Size(); | 127 return SUCCEEDED(hr) ? Size(size.cx, size.cy) : Size(); |
128 } | 128 } |
129 | 129 |
130 void NativeThemeWin::Paint(SkCanvas* canvas, | 130 void NativeThemeWin::Paint(SkCanvas* canvas, |
131 Part part, | 131 Part part, |
132 State state, | 132 State state, |
133 const gfx::Rect& rect, | 133 const gfx::Rect& rect, |
134 const ExtraParams& extra) const { | 134 const ExtraParams& extra) const { |
| 135 if (!skia::SupportsPlatformPaint(canvas)) { |
| 136 // TODO(alokp): Implement this path. |
| 137 // This block will only get hit with --enable-accelerated-drawing flag. |
| 138 DLOG(INFO) << "Could not paint native UI control"; |
| 139 return; |
| 140 } |
| 141 |
135 skia::ScopedPlatformPaint scoped_platform_paint(canvas); | 142 skia::ScopedPlatformPaint scoped_platform_paint(canvas); |
136 HDC hdc = scoped_platform_paint.GetPlatformSurface(); | 143 HDC hdc = scoped_platform_paint.GetPlatformSurface(); |
137 | 144 |
138 switch (part) { | 145 switch (part) { |
139 case kCheckbox: | 146 case kCheckbox: |
140 PaintCheckbox(hdc, part, state, rect, extra.button); | 147 PaintCheckbox(hdc, part, state, rect, extra.button); |
141 break; | 148 break; |
142 case kRadio: | 149 case kRadio: |
143 PaintRadioButton(hdc, part, state, rect, extra.button); | 150 PaintRadioButton(hdc, part, state, rect, extra.button); |
144 break; | 151 break; |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 } | 1531 } |
1525 break; | 1532 break; |
1526 default: | 1533 default: |
1527 NOTREACHED() << "Invalid part: " << part; | 1534 NOTREACHED() << "Invalid part: " << part; |
1528 break; | 1535 break; |
1529 } | 1536 } |
1530 return state_id; | 1537 return state_id; |
1531 } | 1538 } |
1532 | 1539 |
1533 } // namespace gfx | 1540 } // namespace gfx |
OLD | NEW |