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

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

Issue 11031055: Introduce PlatformBitmap, which is a minimal helper class that wraps an SkBitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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
Index: content/browser/renderer_host/backing_store_aura.cc
===================================================================
--- content/browser/renderer_host/backing_store_aura.cc (revision 161107)
+++ content/browser/renderer_host/backing_store_aura.cc (working copy)
@@ -148,20 +148,19 @@
}
bool BackingStoreAura::CopyFromBackingStore(const gfx::Rect& rect,
- skia::PlatformCanvas* output) {
+ skia::PlatformBitmap* output) {
const int width =
std::min(size().width(), rect.width()) * device_scale_factor_;
const int height =
std::min(size().height(), rect.height()) * device_scale_factor_;
- if (!output->initialize(width, height, true))
+ if (!output->Allocate(width, height, true))
return false;
- SkBitmap bitmap = skia::GetTopDevice(*output)->accessBitmap(true);
SkIRect skrect = SkIRect::MakeXYWH(rect.x(), rect.y(), width, height);
SkBitmap b;
if (!canvas_->readPixels(skrect, &b))
return false;
- output->writePixels(b, rect.x(), rect.y());
+ SkCanvas(output->GetBitmap()).writePixels(b, rect.x(), rect.y());
return true;
}
« no previous file with comments | « content/browser/renderer_host/backing_store_aura.h ('k') | content/browser/renderer_host/backing_store_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698