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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
653 case NativeTheme::kColorId_ProminentButtonColor: | 653 case NativeTheme::kColorId_ProminentButtonColor: |
654 return kProminentButtonColorInvert; | 654 return kProminentButtonColorInvert; |
655 default: | 655 default: |
656 return color_utils::InvertColor(GetAuraColor(color_id, this)); | 656 return color_utils::InvertColor(GetAuraColor(color_id, this)); |
657 } | 657 } |
658 } | 658 } |
659 | 659 |
660 return GetAuraColor(color_id, this); | 660 return GetAuraColor(color_id, this); |
661 } | 661 } |
662 | 662 |
663 bool NativeThemeWin::SupportsNinePatch(Part part) const { | |
664 // The only nine-patch resources currently supported (overlay scrollbar) are | |
665 // paitned by NativeThemeAura on Windows. | |
sadrul
2017/03/01 16:30:27
*painted
bokan
2017/03/01 17:02:31
Done.
| |
666 return false; | |
667 } | |
668 | |
669 gfx::Size NativeThemeWin::GetNinePatchCanvasSize(Part part) const { | |
670 NOTREACHED() << "NativeThemeWin doesn't support nine-patch resources."; | |
671 return gfx::Size(); | |
672 } | |
673 | |
674 gfx::Rect NativeThemeWin::GetNinePatchAperture(Part part) const { | |
675 NOTREACHED() << "NativeThemeWin doesn't support nine-patch resources."; | |
676 return gfx::Rect(); | |
677 } | |
678 | |
663 void NativeThemeWin::PaintIndirect(cc::PaintCanvas* destination_canvas, | 679 void NativeThemeWin::PaintIndirect(cc::PaintCanvas* destination_canvas, |
664 Part part, | 680 Part part, |
665 State state, | 681 State state, |
666 const gfx::Rect& rect, | 682 const gfx::Rect& rect, |
667 const ExtraParams& extra) const { | 683 const ExtraParams& extra) const { |
668 // TODO(asvitkine): This path is pretty inefficient - for each paint operation | 684 // TODO(asvitkine): This path is pretty inefficient - for each paint operation |
669 // it creates a new offscreen bitmap Skia canvas. This can be sped up by doing | 685 // it creates a new offscreen bitmap Skia canvas. This can be sped up by doing |
670 // it only once per part/state and keeping a cache of the resulting bitmaps. | 686 // it only once per part/state and keeping a cache of the resulting bitmaps. |
671 // | 687 // |
672 // TODO(enne): This could also potentially be sped up for software raster | 688 // TODO(enne): This could also potentially be sped up for software raster |
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2092 break; | 2108 break; |
2093 case LAST: | 2109 case LAST: |
2094 NOTREACHED(); | 2110 NOTREACHED(); |
2095 break; | 2111 break; |
2096 } | 2112 } |
2097 theme_handles_[theme_name] = handle; | 2113 theme_handles_[theme_name] = handle; |
2098 return handle; | 2114 return handle; |
2099 } | 2115 } |
2100 | 2116 |
2101 } // namespace ui | 2117 } // namespace ui |
OLD | NEW |