summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-05 17:17:08 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-05 17:17:08 +0000
commit49d198eaf7bd7b118fb46b97cc790fdc7b380eee (patch)
treefb0012720373f1e286e06f8cd0595d44c3452d30 /webkit/plugins
parent83da5db25bfd45670eca38f0eb9d6a780090447b (diff)
downloadchromium_src-49d198eaf7bd7b118fb46b97cc790fdc7b380eee.zip
chromium_src-49d198eaf7bd7b118fb46b97cc790fdc7b380eee.tar.gz
chromium_src-49d198eaf7bd7b118fb46b97cc790fdc7b380eee.tar.bz2
rename getBitmapDC to beginPlatformPaint and add calls to endPlatformPaint
This takes a step toward unifying the platform device interface between Windows and Linux and helps to make VectorPlatformDeviceSkia have less ifdefs. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6677142 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80474 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index b8fd69b..ab3302a 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -1231,10 +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.
- skia::VectorPlatformDeviceEmf& device =
- static_cast<skia::VectorPlatformDeviceEmf&>(
- canvas->getTopPlatformDevice());
- HDC dc = device.getBitmapDC();
+ HDC dc = canvas->beginPlatformPaint();
gfx::Size size_in_pixels;
size_in_pixels.set_width(
printing::ConvertUnit(current_print_settings_.printable_area.size.width,
@@ -1256,6 +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();
#endif // defined(OS_WIN)
return ret;
@@ -1322,10 +1320,7 @@ bool PluginInstance::DrawJPEGToPlatformDC(
const SkBitmap& bitmap,
const gfx::Rect& printable_area,
WebKit::WebCanvas* canvas) {
- skia::VectorPlatformDeviceEmf& device =
- static_cast<skia::VectorPlatformDeviceEmf&>(
- canvas->getTopPlatformDevice());
- HDC dc = device.getBitmapDC();
+ HDC dc = canvas->beginPlatformPaint();
// 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.
@@ -1364,6 +1359,7 @@ bool PluginInstance::DrawJPEGToPlatformDC(
&compressed_image.front(),
reinterpret_cast<const BITMAPINFO*>(&bmi),
DIB_RGB_COLORS, SRCCOPY);
+ canvas->endPlatformPaint();
return true;
}
#endif // OS_WIN