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 /webkit/plugins/ppapi | |
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 'webkit/plugins/ppapi')
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index 082d96e..265885c 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -1231,7 +1231,7 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output, #elif defined(OS_WIN) // On Windows, we now need to render the PDF to the DC that backs the // supplied canvas. - HDC dc = canvas->beginPlatformPaint(); + HDC dc = skia::BeginPlatformPaint(canvas); gfx::Size size_in_pixels; size_in_pixels.set_width( printing::ConvertUnit(current_print_settings_.printable_area.size.width, @@ -1253,7 +1253,7 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output, current_print_settings_.dpi, current_print_settings_.dpi, 0, 0, size_in_pixels.width(), size_in_pixels.height(), true, false, true, true); - canvas->endPlatformPaint(); + skia::EndPlatformPaint(canvas); #endif // defined(OS_WIN) return ret; @@ -1340,7 +1340,7 @@ bool PluginInstance::DrawJPEGToPlatformDC( return false; } - HDC dc = canvas->beginPlatformPaint(); + HDC dc = skia::BeginPlatformPaint(canvas); // TODO(sanjeevr): This is a temporary hack. If we output a JPEG // to the EMF, the EnumEnhMetaFile call fails in the browser // process. The failure also happens if we output nothing here. @@ -1359,7 +1359,7 @@ bool PluginInstance::DrawJPEGToPlatformDC( &compressed_image.front(), reinterpret_cast<const BITMAPINFO*>(&bmi), DIB_RGB_COLORS, SRCCOPY); - canvas->endPlatformPaint(); + skia::EndPlatformPaint(canvas); return true; } #endif // OS_WIN |