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

Unified Diff: content/browser/renderer_host/backing_store_mac.mm

Issue 18052011: Fix CopyFromBackingStore when there's no cg_layer_. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698