Chromium Code Reviews| Index: ui/native_theme/native_theme_win.cc |
| diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc |
| index cc66d70f5633cb6f2fa40d6d801ec9a9a5f703cb..df747651103e9d8230e6494fde2ae15240405bde 100644 |
| --- a/ui/native_theme/native_theme_win.cc |
| +++ b/ui/native_theme/native_theme_win.cc |
| @@ -257,38 +257,13 @@ void NativeThemeWin::Paint(SkCanvas* canvas, |
| break; |
| } |
| - bool needs_paint_indirect = false; |
| - if (!skia::SupportsPlatformPaint(canvas)) { |
| - // This block will only get hit with --enable-accelerated-drawing flag. |
| - needs_paint_indirect = true; |
| - } else { |
| - // Scrollbar components on Windows Classic theme (on all Windows versions) |
| - // have particularly problematic alpha values, so always draw them |
| - // indirectly. In addition, scrollbar thumbs and grippers for the Windows XP |
| - // theme (available only on Windows XP) also need their alpha values |
| - // fixed. |
| - switch (part) { |
| - case kScrollbarDownArrow: |
| - case kScrollbarUpArrow: |
| - case kScrollbarLeftArrow: |
| - case kScrollbarRightArrow: |
| - needs_paint_indirect = !GetThemeHandle(SCROLLBAR); |
| - break; |
| - case kScrollbarHorizontalThumb: |
| - case kScrollbarVerticalThumb: |
| - case kScrollbarHorizontalGripper: |
| - case kScrollbarVerticalGripper: |
| - needs_paint_indirect = !GetThemeHandle(SCROLLBAR) || |
| - base::win::GetVersion() == base::win::VERSION_XP; |
| - break; |
| - default: |
| - break; |
| - } |
| - } |
| - |
| skia::ScopedPlatformPaint paint(canvas); |
| HDC surface = paint.GetPlatformSurface(); |
| - if (needs_paint_indirect) |
| + |
| + // When drawing the task manager or the bookmark editor, we draw into an |
| + // offscreen buffer, where we can use OS-specific drawing routines for |
| + // UI features like scrollbars. |
| + if (!skia::SupportsPlatformPaint(canvas)) |
|
Peter Kasting
2016/08/15 22:29:41
Nit: Reverse conditional and arms (so "else" claus
|
| PaintIndirect(canvas, surface, part, state, rect, extra); |
| else |
| PaintDirect(canvas, surface, part, state, rect, extra); |