Index: chrome/renderer/print_web_view_helper_win.cc |
=================================================================== |
--- chrome/renderer/print_web_view_helper_win.cc (revision 167432) |
+++ chrome/renderer/print_web_view_helper_win.cc (working copy) |
@@ -38,7 +38,7 @@ |
WebFrame* frame) { |
// Generate a memory-based metafile. It will use the current screen's DPI. |
// Each metafile contains a single page. |
- scoped_ptr<Metafile> metafile(new printing::NativeMetafile); |
+ scoped_ptr<printing::NativeMetafile> metafile(new printing::NativeMetafile); |
metafile->Init(); |
DCHECK(metafile->context()); |
skia::InitializeDC(metafile->context()); |
@@ -62,6 +62,13 @@ |
if (!metafile->FinishDocument()) |
NOTREACHED(); |
+ if (!params.params.supports_alpha_blend && metafile->IsAlphaBlendUsed()) { |
+ scoped_ptr<printing::NativeMetafile> raster_metafile( |
+ metafile->RasterizeAlphaBlend()); |
+ if (raster_metafile.get()) |
+ metafile.swap(raster_metafile); |
+ } |
+ |
// Get the size of the compiled metafile. |
uint32 buf_size = metafile->GetDataSize(); |
DCHECK_GT(buf_size, 128u); |