Index: content/browser/renderer_host/backing_store_mac.mm |
diff --git a/content/browser/renderer_host/backing_store_mac.mm b/content/browser/renderer_host/backing_store_mac.mm |
index 90a0e0b1bc886fce3da2e4263d64ec692597acd6..8b3fda9840d37e2fec8850337ffe0675369b8e57 100644 |
--- a/content/browser/renderer_host/backing_store_mac.mm |
+++ b/content/browser/renderer_host/backing_store_mac.mm |
@@ -172,8 +172,18 @@ bool BackingStoreMac::CopyFromBackingStore(const gfx::Rect& rect, |
gfx::ScopedCGContextSaveGState save_gstate(temp_context); |
CGContextTranslateCTM(temp_context, 0.0, size().height()); |
Nico
2013/07/01 16:55:00
size() returns logical size, which isn't right for
|
CGContextScaleCTM(temp_context, 1.0, -1.0); |
- CGContextDrawLayerAtPoint(temp_context, CGPointMake(-rect.x(), -rect.y()), |
- cg_layer()); |
+ if (cg_layer()) { |
+ CGContextDrawLayerAtPoint(temp_context, CGPointMake(-rect.x(), -rect.y()), |
+ cg_layer()); |
+ } else { |
+ base::ScopedCFTypeRef<CGImageRef> bitmap_image( |
+ CGBitmapContextCreateImage(cg_bitmap_)); |
+ CGContextDrawImage( |
+ temp_context, |
+ CGRectMake(-rect.x(), -rect.y(), rect.width(), rect.height()), |
+ bitmap_image); |
+ } |
+ |
return true; |
} |