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

Unified Diff: ui/gfx/compositor/compositor.h

Issue 8463024: Implement CompositorCC::ReadPixels (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor host API change. 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 | « no previous file | ui/gfx/compositor/compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/compositor.h
diff --git a/ui/gfx/compositor/compositor.h b/ui/gfx/compositor/compositor.h
index 9343975561b76ffd8293399931233de6233cd176..027b9c45c08292e1d3a4ff88bb971fdccedcaee7 100644
--- a/ui/gfx/compositor/compositor.h
+++ b/ui/gfx/compositor/compositor.h
@@ -129,7 +129,8 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> {
void Draw(bool force_clear);
// Reads the contents of the last rendered frame into the given bitmap.
- virtual void ReadPixels(SkBitmap* bitmap) = 0;
+ // Returns false if the pixels could not be read.
+ virtual bool ReadPixels(SkBitmap* bitmap) = 0;
// Notifies the compositor that the size of the widget that it is
// drawing to has changed.
@@ -175,6 +176,11 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> {
CompositorDelegate* delegate() { return delegate_; }
+ // When reading back pixel data we often get RGBA rather than BGRA pixels and
+ // and the image often needs to be flipped vertically.
+ static void SwizzleRGBAToBGRAAndFlip(unsigned char* pixels,
+ const gfx::Size& image_size);
+
private:
// Notifies the compositor that compositing is about to start. See Draw() for
// notes about |force_clear|.
« no previous file with comments | « no previous file | ui/gfx/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698