[oe-commits] Koen Kooi : fennec: use native bpp to speed up rendering on 16bit framebuffers

git version control git at git.openembedded.org
Sun Jun 21 18:46:45 UTC 2009


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 693a76b58e7f9fdb76ab152dbab1d4c39f5f0fae
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=693a76b58e7f9fdb76ab152dbab1d4c39f5f0fae

Author: Koen Kooi <koen at openembedded.org>
Date:   Sun Jun 21 20:42:26 2009 +0200

fennec: use native bpp to speed up rendering on 16bit framebuffers
* helps with memusage as well

---

 recipes/mozilla/fennec/use-native-bpp.patch |   81 +++++++++++++++++++++++++++
 recipes/mozilla/fennec_hg.bb                |    3 +-
 2 files changed, 83 insertions(+), 1 deletions(-)

diff --git a/recipes/mozilla/fennec/use-native-bpp.patch b/recipes/mozilla/fennec/use-native-bpp.patch
new file mode 100644
index 0000000..fd3f9b7
--- /dev/null
+++ b/recipes/mozilla/fennec/use-native-bpp.patch
@@ -0,0 +1,81 @@
+diff -r f603fec24bf7 gfx/thebes/src/gfxPlatformGtk.cpp
+--- a/gfx/thebes/src/gfxPlatformGtk.cpp	Tue Dec 02 16:05:36 2008 -0500
++++ b/gfx/thebes/src/gfxPlatformGtk.cpp	Tue Dec 02 23:14:03 2008 -0500
+@@ -80,18 +80,23 @@
+ 
+ #define GDK_PIXMAP_SIZE_MAX 32767
+ 
+ #ifndef MOZ_PANGO
+ #include <ft2build.h>
+ #include FT_FREETYPE_H
+ #endif
+ 
++#include "nsIPrefService.h"
++#include "nsIPrefBranch.h"
++#include "nsServiceManagerUtils.h"
++
+ double gfxPlatformGtk::sDPI = -1.0;
+ gfxFontconfigUtils *gfxPlatformGtk::sFontconfigUtils = nsnull;
++static PRBool gUseSystemVisualFormat = PR_FALSE;
+ 
+ #ifndef MOZ_PANGO
+ typedef nsDataHashtable<nsStringHashKey, nsRefPtr<FontFamily> > FontTable;
+ static FontTable *gPlatformFonts = NULL;
+ static FontTable *gPlatformFontAliases = NULL;
+ static FT_Library gPlatformFTLibrary = NULL;
+ #endif
+ 
+@@ -113,16 +118,26 @@ gfxPlatformGtk::gfxPlatformGtk()
+     gPlatformFonts = new FontTable();
+     gPlatformFonts->Init(100);
+     gPlatformFontAliases = new FontTable();
+     gPlatformFontAliases->Init(100);
+     UpdateFontList();
+ #endif
+ 
+     InitDPI();
++
++    nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
++    if (!prefs)
++        return;
++
++    PRBool val = PR_FALSE;
++    nsresult rv;
++    rv = prefs->GetBoolPref("gfx.system.visual.format", &val);
++    if (NS_SUCCEEDED(rv))
++        gUseSystemVisualFormat = val;
+ }
+ 
+ gfxPlatformGtk::~gfxPlatformGtk()
+ {
+     gfxFontconfigUtils::Shutdown();
+     sFontconfigUtils = nsnull;
+ 
+ #ifdef MOZ_PANGO
+@@ -184,18 +199,24 @@ gfxPlatformGtk::CreateOffscreenSurface(c
+     // XXX we really need a different interface here, something that passes
+     // in more context, including the display and/or target surface type that
+     // we should try to match
+     Display* display = GDK_DISPLAY();
+     if (!display)
+         return nsnull;
+ 
+     GdkPixmap* pixmap = nsnull;
+-    XRenderPictFormat* xrenderFormat =
+-        XRenderFindStandardFormat(display, xrenderFormatID);
++    XRenderPictFormat* xrenderFormat = nsnull;
++
++    if (xrenderFormatID == PictStandardRGB24 && gUseSystemVisualFormat) {
++        // Actually we want not strictly RGB24, but the fastest non-alpha
++        // format (XXX to be verified if it is actually safe)
++        xrenderFormat = XRenderFindVisualFormat(display, GDK_VISUAL_XVISUAL(gdk_visual_get_system()));
++    }
++    if (!xrenderFormat) xrenderFormat = XRenderFindStandardFormat(display, xrenderFormatID);
+ 
+     if (xrenderFormat && sizeOk) {
+         pixmap = gdk_pixmap_new(nsnull, size.width, size.height,
+                                 xrenderFormat->depth);
+ 
+         if (pixmap) {
+             gdk_drawable_set_colormap(GDK_DRAWABLE(pixmap), nsnull);
+             newSurface = new gfxXlibSurface(display,
diff --git a/recipes/mozilla/fennec_hg.bb b/recipes/mozilla/fennec_hg.bb
index 3b236f1..9499613 100644
--- a/recipes/mozilla/fennec_hg.bb
+++ b/recipes/mozilla/fennec_hg.bb
@@ -2,13 +2,14 @@ DESCRIPTION = "Mozilla Mobile browser"
 
 PV = "0.9+1.0b2pre"
 MOZPV = "1.0b2pre"
-PR = "r4"
+PR = "r5"
 PE = "1"
 
 SRC_URI = "hg://hg.mozilla.org/;module=mozilla-central;rev=8c9a6d851018 \
            hg://hg.mozilla.org/;module=mobile-browser;rev=c24b8b4ade53 \
            file://jsautocfg.h \
            file://jsautocfg-dontoverwrite.patch;patch=1 \
+           file://use-native-bpp.patch;patch=1 \
 "
 
 S = "${WORKDIR}/mozilla-central"





More information about the Openembedded-commits mailing list