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

Unified Diff: content/browser/renderer_host/backing_store_skia.cc

Issue 7304005: Gets BackingStoreSkia to work on windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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_skia.cc
diff --git a/content/browser/renderer_host/backing_store_skia.cc b/content/browser/renderer_host/backing_store_skia.cc
index 8c79958c2ffd9d3f0b2134c7e7b85e2142ba1c11..c11e8c1a3ff00e3ca46dbc9d0cc35329b7439415 100644
--- a/content/browser/renderer_host/backing_store_skia.cc
+++ b/content/browser/renderer_host/backing_store_skia.cc
@@ -60,8 +60,18 @@ void BackingStoreSkia::PaintToBackingStore(
if (!dib)
return;
+ SkBitmap b;
+#if defined(OS_WIN)
+ // Creating a platform canvas on windows results in attempting to map the
brettw 2011/07/01 22:26:22 Actually your new code is better on all platforms.
+ // memory again (by CreateDIBSection). We want to avoid that, so we directly
+ // create the bitmap.
+ b.setConfig(SkBitmap::kARGB_8888_Config, width, height);
+ b.setPixels(dib->memory());
+#else
scoped_ptr<skia::PlatformCanvas> p_canvas(
dib->GetPlatformCanvas(width, height));
+ b = skia::GetTopDevice(*p_canvas)->accessBitmap(false);
+#endif
for (size_t i = 0; i < copy_rects.size(); i++) {
const gfx::Rect& copy_rect = copy_rects[i];
int x = copy_rect.x() - bitmap_rect.x();
@@ -72,7 +82,6 @@ void BackingStoreSkia::PaintToBackingStore(
SkRect dstrect = SkRect::MakeXYWH(
SkIntToScalar(copy_rect.x()), SkIntToScalar(copy_rect.y()),
SkIntToScalar(w), SkIntToScalar(h));
- SkBitmap b = skia::GetTopDevice(*p_canvas)->accessBitmap(false);
canvas_.get()->drawBitmapRect(b, &srcrect, dstrect);
}
}
« 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