| 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 #include "ui/native_theme/native_theme_win.h" | 5 #include "ui/native_theme/native_theme_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <uxtheme.h> | 9 #include <uxtheme.h> |
| 10 #include <vsstyle.h> | 10 #include <vsstyle.h> |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 PaintMenuBackground(canvas, rect); | 271 PaintMenuBackground(canvas, rect); |
| 272 return; | 272 return; |
| 273 case kMenuItemBackground: | 273 case kMenuItemBackground: |
| 274 CommonThemePaintMenuItemBackground(this, canvas, state, rect, | 274 CommonThemePaintMenuItemBackground(this, canvas, state, rect, |
| 275 extra.menu_item); | 275 extra.menu_item); |
| 276 return; | 276 return; |
| 277 default: | 277 default: |
| 278 break; | 278 break; |
| 279 } | 279 } |
| 280 | 280 |
| 281 skia::ScopedPlatformPaint paint(canvas); | 281 HDC surface = skia::GetNativeDrawingContext(canvas); |
| 282 HDC surface = paint.GetNativeDrawingContext(); | |
| 283 | 282 |
| 284 // When drawing the task manager or the bookmark editor, we draw into an | 283 // When drawing the task manager or the bookmark editor, we draw into an |
| 285 // offscreen buffer, where we can use OS-specific drawing routines for | 284 // offscreen buffer, where we can use OS-specific drawing routines for |
| 286 // UI features like scrollbars. However, we need to set up that buffer, | 285 // UI features like scrollbars. However, we need to set up that buffer, |
| 287 // and then read it back when it's done and blit it onto the screen. | 286 // and then read it back when it's done and blit it onto the screen. |
| 288 | 287 |
| 289 if (skia::SupportsPlatformPaint(canvas)) | 288 if (skia::SupportsPlatformPaint(canvas)) |
| 290 PaintDirect(canvas, surface, part, state, rect, extra); | 289 PaintDirect(canvas, surface, part, state, rect, extra); |
| 291 else | 290 else |
| 292 PaintIndirect(canvas, surface, part, state, rect, extra); | 291 PaintIndirect(canvas, surface, part, state, rect, extra); |
| (...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2105 break; | 2104 break; |
| 2106 case LAST: | 2105 case LAST: |
| 2107 NOTREACHED(); | 2106 NOTREACHED(); |
| 2108 break; | 2107 break; |
| 2109 } | 2108 } |
| 2110 theme_handles_[theme_name] = handle; | 2109 theme_handles_[theme_name] = handle; |
| 2111 return handle; | 2110 return handle; |
| 2112 } | 2111 } |
| 2113 | 2112 |
| 2114 } // namespace ui | 2113 } // namespace ui |
| OLD | NEW |