Chromium Code Reviews| Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc |
| =================================================================== |
| --- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 80484) |
| +++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy) |
| @@ -1320,15 +1320,6 @@ |
| const SkBitmap& bitmap, |
| const gfx::Rect& printable_area, |
| WebKit::WebCanvas* canvas) { |
| - 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. |
| - // We need to investigate the reason for this failure and fix it. |
| - // In the meantime this temporary hack of drawing an empty |
| - // rectangle in the DC gets us by. |
| - Rectangle(dc, 0, 0, 0, 0); |
| - |
| // Ideally we should add JPEG compression to the VectorPlatformDevice class |
| // However, Skia currently has no JPEG compression code and we cannot |
| // depend on gfx/jpeg_codec.h in Skia. So we do the compression here. |
| @@ -1348,6 +1339,15 @@ |
| NOTREACHED(); |
| return false; |
| } |
| + |
| + HDC dc = canvas->beginPlatformPaint(); |
|
vandebo (ex-Chrome)
2011/04/05 20:38:49
*B*eginPlatformPaint
alokp
2011/04/05 20:49:29
This is a call on canvas, not device. I am not fix
vandebo (ex-Chrome)
2011/04/05 20:59:09
Oops, right.
|
| + // 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. |
| + // We need to investigate the reason for this failure and fix it. |
| + // In the meantime this temporary hack of drawing an empty |
| + // rectangle in the DC gets us by. |
| + Rectangle(dc, 0, 0, 0, 0); |
| BITMAPINFOHEADER bmi = {0}; |
| gfx::CreateBitmapHeader(bitmap.width(), bitmap.height(), &bmi); |
| bmi.biCompression = BI_JPEG; |