diff options
author | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-10 20:54:50 +0000 |
---|---|---|
committer | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-10 20:54:50 +0000 |
commit | 6a95711c6b60866b0b810d9fcc7503806f44dbf0 (patch) | |
tree | 68a5d35f909432aa0a19f37c74e7d946a9bb2731 /ui/gfx/native_theme_win.h | |
parent | 615a3de168aa22c73cd25fc44a919d708cf2d9c6 (diff) | |
download | chromium_src-6a95711c6b60866b0b810d9fcc7503806f44dbf0.zip chromium_src-6a95711c6b60866b0b810d9fcc7503806f44dbf0.tar.gz chromium_src-6a95711c6b60866b0b810d9fcc7503806f44dbf0.tar.bz2 |
Enable NativeThemeWin to draw to non-HDC backed canvas. For example, an accelerated canvas via Ganesh.
This change adds a code path to NativeThemeWin that will be taken when skia::SupportsPlatformPaint(canvas) is false (i.e. the canvas is not backed by an HDC).
In this path, this code will create a temporary offscreen HDC-backed bitmap and draw into that first, followed by drawing the bitmap to the canvas.
Unfortunately, some of the Windows theme drawing APIs do not set correct alphas when painting to non-opaque destinations. As a result, the code has to do some tricks to work-around this (more details in the code and comments).
This is an initial implementation that creates an offscreen bitmap for each paint operation, which is inefficient. This can be sped up in the future by building a cache of the bitmaps.
BUG=none
TEST=manual using a test-page with many different form controls
Review URL: http://codereview.chromium.org/7125011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88722 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/native_theme_win.h')
-rw-r--r-- | ui/gfx/native_theme_win.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/gfx/native_theme_win.h b/ui/gfx/native_theme_win.h index 534990e..61420a5 100644 --- a/ui/gfx/native_theme_win.h +++ b/ui/gfx/native_theme_win.h @@ -109,6 +109,12 @@ class NativeThemeWin : public NativeTheme { const gfx::Rect& rect, const ExtraParams& extra) const; + void PaintToNonPlatformCanvas(SkCanvas* canvas, + Part part, + State state, + const gfx::Rect& rect, + const ExtraParams& extra) const; + HRESULT GetThemePartSize(ThemeName themeName, HDC hdc, int part_id, |