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

Unified Diff: ui/gfx/compositor/compositor_cc.cc

Issue 8558033: Revert 110783 - Adds a bounds parameter to ui::Compositor::ReadPixels (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 | « ui/gfx/compositor/compositor_cc.h ('k') | ui/gfx/compositor/compositor_gl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/compositor_cc.cc
===================================================================
--- ui/gfx/compositor/compositor_cc.cc (revision 110784)
+++ ui/gfx/compositor/compositor_cc.cc (working copy)
@@ -182,21 +182,14 @@
host_.composite();
}
-bool CompositorCC::ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds) {
- if (bounds.right() > size().width() || bounds.bottom() > size().height())
- return false;
- // Convert to OpenGL coordinates.
- gfx::Point new_origin(bounds.x(),
- size().height() - bounds.height() - bounds.y());
-
+bool CompositorCC::ReadPixels(SkBitmap* bitmap) {
bitmap->setConfig(SkBitmap::kARGB_8888_Config,
- bounds.width(), bounds.height());
+ size().width(), size().height());
bitmap->allocPixels();
SkAutoLockPixels lock_image(*bitmap);
unsigned char* pixels = static_cast<unsigned char*>(bitmap->getPixels());
- if (host_.compositeAndReadback(pixels,
- gfx::Rect(new_origin, bounds.size()))) {
- SwizzleRGBAToBGRAAndFlip(pixels, bounds.size());
+ if (host_.compositeAndReadback(pixels, gfx::Rect(size()))) {
+ SwizzleRGBAToBGRAAndFlip(pixels, size());
return true;
}
return false;
« no previous file with comments | « ui/gfx/compositor/compositor_cc.h ('k') | ui/gfx/compositor/compositor_gl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698