diff options
author | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-08 17:36:26 +0000 |
---|---|---|
committer | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-08 17:36:26 +0000 |
commit | afc4ce91f94bc0cb976884e1c1c785a9e75f127a (patch) | |
tree | 0c64c063fe026abd1f2a81a97fe04b9dfd514702 /ui | |
parent | 73689e53255c6ac22a90b0cd01fe40180ec2bbba (diff) | |
download | chromium_src-afc4ce91f94bc0cb976884e1c1c785a9e75f127a.zip chromium_src-afc4ce91f94bc0cb976884e1c1c785a9e75f127a.tar.gz chromium_src-afc4ce91f94bc0cb976884e1c1c785a9e75f127a.tar.bz2 |
Eliminate skia::PlatformCanvas, a subclass of SkCanvas. Skia provides multiple types of SkCanvas classes that we would like to use. Unfortunately these classes are implemented as subclasses of SkCanvas. Subclassing SkCanvas in both Skia and Chromium makes it impossible to dynamically use any SkCanvas. There is also no reason for chromium to subclass SkCanvas. Most of the extra functionalities can be implemented by hanging meta-data from SkCanvas.
We cannot eliminate skia::PlatformCanvas in one step due to WebKit's dependency on skia::PlatformCanvas. WebKit::WebCanvas is typedef as skia::PlatformDevice. It should be SkCanvas. So we need to do it in multiple steps:
1. Prepare Chromium tree for the change in WebKit::WebCanvas tyepdef. This basically means adding a couple of static_cast<skia::PlatformCanvas>(WebCanvas).
2. Change WebKit::WebCanvas typedef from skia::PlatformCanvas to SkCanvas
3. Eliminate skia::PlatformCanvas in chromium
This CL accomplishes the first step on windows.
WebKit BUG=https://bugs.webkit.org/show_bug.cgi?id=57563
Review URL: http://codereview.chromium.org/6783023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80955 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/native_theme_win.cc | 8 | ||||
-rw-r--r-- | ui/gfx/native_theme_win.h | 10 |
2 files changed, 8 insertions, 10 deletions
diff --git a/ui/gfx/native_theme_win.cc b/ui/gfx/native_theme_win.cc index a118643..ce5f1e1 100644 --- a/ui/gfx/native_theme_win.cc +++ b/ui/gfx/native_theme_win.cc @@ -14,8 +14,8 @@ #include "base/win/scoped_gdi_object.h" #include "base/win/scoped_hdc.h" #include "base/win/windows_version.h" -#include "skia/ext/platform_canvas.h" #include "skia/ext/skia_utils_win.h" +#include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkShader.h" #include "ui/gfx/gdi_util.h" #include "ui/gfx/rect.h" @@ -540,7 +540,7 @@ HRESULT NativeThemeWin::PaintScrollbarTrack( int classic_state, RECT* target_rect, RECT* align_rect, - skia::PlatformCanvas* canvas) const { + SkCanvas* canvas) const { HANDLE handle = GetThemeHandle(SCROLLBAR); if (handle && draw_theme_) return draw_theme_(handle, hdc, part_id, state_id, target_rect, NULL); @@ -623,7 +623,7 @@ HRESULT NativeThemeWin::PaintTrackbar(HDC hdc, int state_id, int classic_state, RECT* rect, - skia::PlatformCanvas* canvas) const { + SkCanvas* canvas) const { // Make the channel be 4 px thick in the center of the supplied rect. (4 px // matches what XP does in various menus; GetThemePartSize() doesn't seem to // return good values here.) @@ -732,7 +732,7 @@ HRESULT NativeThemeWin::PaintProgressBar(HDC hdc, RECT* value_rect, bool determinate, double animated_seconds, - skia::PlatformCanvas* canvas) const { + SkCanvas* canvas) const { // There is no documentation about the animation speed, frame-rate, nor // size of moving overlay of the indeterminate progress bar. // So we just observed real-world programs and guessed following parameters. diff --git a/ui/gfx/native_theme_win.h b/ui/gfx/native_theme_win.h index 364e29c..3ec1d55 100644 --- a/ui/gfx/native_theme_win.h +++ b/ui/gfx/native_theme_win.h @@ -19,9 +19,7 @@ #include "base/basictypes.h" #include "third_party/skia/include/core/SkColor.h" -namespace skia { -class PlatformCanvas; -} // namespace skia +class SkCanvas; namespace gfx { @@ -253,7 +251,7 @@ class NativeThemeWin : public NativeTheme { int classic_state, RECT* target_rect, RECT* align_rect, - skia::PlatformCanvas* canvas) const; + SkCanvas* canvas) const; // This method is deprecated and will be removed in the near future. // Paints a scrollbar thumb or gripper. @@ -296,7 +294,7 @@ class NativeThemeWin : public NativeTheme { int state_id, int classic_state, RECT* rect, - skia::PlatformCanvas* canvas) const; + SkCanvas* canvas) const; // This method is deprecated and will be removed in the near future. HRESULT PaintProgressBar(HDC hdc, @@ -304,7 +302,7 @@ class NativeThemeWin : public NativeTheme { RECT* value_rect, bool determinate, double animated_seconds, - skia::PlatformCanvas* canvas) const; + SkCanvas* canvas) const; private: NativeThemeWin(); |