Support 32-bit color depth in gonk widget backend (bug 767288, r=cjones).
authorAndreas Gal <gal@mozilla.com>
Fri, 22 Jun 2012 01:18:54 -0700
changeset 97371 c0221764624b1866ba8fa475b460bbc5134b864e
parent 97370 c9dec2d6c44555b2011267a5894b6033bc1f2580
child 97372 71f3a9a2b160385610e68ebdd76c977ad90cea7a
push id11008
push useragal@mozilla.com
push dateFri, 22 Jun 2012 08:21:24 +0000
treeherdermozilla-inbound@c0221764624b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs767288
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Support 32-bit color depth in gonk widget backend (bug 767288, r=cjones).
widget/gonk/nsWindow.cpp
--- a/widget/gonk/nsWindow.cpp
+++ b/widget/gonk/nsWindow.cpp
@@ -600,17 +600,23 @@ nsScreenGonk::GetAvailRect(PRInt32 *outL
                            PRInt32 *outWidth, PRInt32 *outHeight)
 {
     return GetRect(outLeft, outTop, outWidth, outHeight);
 }
 
 static uint32_t
 ColorDepth()
 {
-    return gNativeWindow->getDevice()->format == GGL_PIXEL_FORMAT_RGB_565 ? 16 : 24;
+    switch (gNativeWindow->getDevice()->format) {
+    case GGL_PIXEL_FORMAT_RGB_565:
+        return 16;
+    case GGL_PIXEL_FORMAT_RGBA_8888:
+        return 32;
+    }
+    return 24; // GGL_PIXEL_FORMAT_RGBX_8888
 }
 
 NS_IMETHODIMP
 nsScreenGonk::GetPixelDepth(PRInt32 *aPixelDepth)
 {
     // XXX: this should actually return 32 when we're using 24-bit
     // color, because we use RGBX.
     *aPixelDepth = ColorDepth();