Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 6677142: rename getBitmapDC to beginPlatformPaint and add calls to endPlatformPaint (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/widget/widget_win.cc ('k') | webkit/tools/test_shell/webwidget_host_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index b8fd69b0fe6f55acef6e72768bd61e27bfbe02ce..ab3302af036fc3bd3c74e6cdf7573487cc71d75a 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
« no previous file with comments | « views/widget/widget_win.cc ('k') | webkit/tools/test_shell/webwidget_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698