diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js
index 1d2852175601..4cda9a1f4c4f 100644
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -852,6 +852,9 @@ pref("gfx.canvas.azure.accelerated", true);
// Turn on dynamic cache size for Skia
pref("gfx.canvas.skiagl.dynamic-cache", true);
+// Limit skia to canvases the size of the device screen or smaller
+pref("gfx.canvas.max-size-for-skia-gl", -1);
+
// enable fence with readpixels for SurfaceStream
pref("gfx.gralloc.fence-with-readpixels", true);
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 278f4aea3e89..a04770b38084 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,12 +19,12 @@
-
+
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 3a31a3640149..3a5c49b692b7 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,9 +17,9 @@
-
+
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 1e79427ebddf..89b531b3f928 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,10 +15,10 @@
-
+
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 278f4aea3e89..a04770b38084 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,12 +19,12 @@
-
+
-
+
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 2a20570c09d1..41b81d27fef3 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "ec183496896f2902121bce52413c75f917bea5c9",
+ "revision": "c159b9cb625a90109a032364ba54e101787e4adb",
"repo_path": "/integration/gaia-central"
}
diff --git a/b2g/config/hamachi/config.json b/b2g/config/hamachi/config.json
index b5adda66eb61..f2e15665f0b8 100644
--- a/b2g/config/hamachi/config.json
+++ b/b2g/config/hamachi/config.json
@@ -15,14 +15,6 @@
"{objdir}/dist/b2g-*.tar.gz",
"{workdir}/sources.xml"
],
- "zip_files": [
- ["{workdir}/out/target/product/hamachi/*.img", "out/target/product/hamachi/"],
- ["{workdir}/boot.img", "out/target/product/hamachi/"],
- "{workdir}/flash.sh",
- "{workdir}/load-config.sh",
- "{workdir}/.config",
- "{workdir}/sources.xml"
- ],
"env": {
"VARIANT": "user",
"MOZILLA_OFFICIAL": "1"
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index eb47bd5183ad..2532ca7a782e 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,11 +17,11 @@
-
+
-
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index 82359cc59e12..5d0c41643776 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,11 +15,11 @@
-
+
-
+
diff --git a/b2g/config/inari/sources.xml b/b2g/config/inari/sources.xml
index b11aa5d836a6..1f121bc631f6 100644
--- a/b2g/config/inari/sources.xml
+++ b/b2g/config/inari/sources.xml
@@ -19,11 +19,11 @@
-
+
-
+
diff --git a/b2g/config/leo/sources.xml b/b2g/config/leo/sources.xml
index 4cb0bc3ce4f2..fcdfb1153756 100644
--- a/b2g/config/leo/sources.xml
+++ b/b2g/config/leo/sources.xml
@@ -17,11 +17,11 @@
-
+
-
+
diff --git a/b2g/config/mako/sources.xml b/b2g/config/mako/sources.xml
index d2abb9edc330..b48834d1a4ee 100644
--- a/b2g/config/mako/sources.xml
+++ b/b2g/config/mako/sources.xml
@@ -17,9 +17,9 @@
-
+
-
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index c0891ab42427..153b78cb73cf 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,11 +17,11 @@
-
+
-
+
diff --git a/content/canvas/src/CanvasRenderingContext2D.cpp b/content/canvas/src/CanvasRenderingContext2D.cpp
index a33e489d93f8..b7dcbae87371 100755
--- a/content/canvas/src/CanvasRenderingContext2D.cpp
+++ b/content/canvas/src/CanvasRenderingContext2D.cpp
@@ -95,6 +95,7 @@
#include "GLContext.h"
#include "GLContextProvider.h"
#include "SVGContentUtils.h"
+#include "nsIScreenManager.h"
#undef free // apparently defined by some windows header, clashing with a free()
// method in SkTypes.h
@@ -822,8 +823,48 @@ CanvasRenderingContext2D::RemoveDemotableContext(CanvasRenderingContext2D* conte
bool
CheckSizeForSkiaGL(IntSize size) {
+ MOZ_ASSERT(NS_IsMainThread());
+
int minsize = Preferences::GetInt("gfx.canvas.min-size-for-skia-gl", 128);
- return size.width >= minsize && size.height >= minsize;
+ if (size.width < minsize || size.height < minsize) {
+ return false;
+ }
+
+ // Maximum pref allows 3 different options:
+ // 0 means unlimited size
+ // > 0 means use value as an absolute threshold
+ // < 0 means use the number of screen pixels as a threshold
+ int maxsize = Preferences::GetInt("gfx.canvas.max-size-for-skia-gl", 0);
+
+ // unlimited max size
+ if (!maxsize) {
+ return true;
+ }
+
+ // absolute max size threshold
+ if (maxsize > 0) {
+ return size.width <= maxsize && size.height <= maxsize;
+ }
+
+ // Cache the number of pixels on the primary screen
+ static int32_t gScreenPixels = -1;
+ if (gScreenPixels < 0) {
+ nsCOMPtr screenManager =
+ do_GetService("@mozilla.org/gfx/screenmanager;1");
+ if (screenManager) {
+ nsCOMPtr primaryScreen;
+ screenManager->GetPrimaryScreen(getter_AddRefs(primaryScreen));
+ if (primaryScreen) {
+ int32_t x, y, width, height;
+ primaryScreen->GetRect(&x, &y, &width, &height);
+
+ gScreenPixels = width * height;
+ }
+ }
+ }
+
+ // screen size acts as max threshold
+ return gScreenPixels < 0 || (size.width * size.height) <= gScreenPixels;
}
void
diff --git a/dom/apps/tests/mochitest.ini b/dom/apps/tests/mochitest.ini
index 04f3d873fc98..f79e8dc3cbee 100644
--- a/dom/apps/tests/mochitest.ini
+++ b/dom/apps/tests/mochitest.ini
@@ -1,5 +1,5 @@
[DEFAULT]
-skip-if = toolkit=='gonk' || e10s #b2g(bug 972927, nearly perma-fail) b2g-debug(bug 972927, nearly perma-fail)
+skip-if = e10s
support-files =
chromeAddCert.js
file_app.sjs
@@ -15,15 +15,11 @@ support-files =
signed/*
[test_app_update.html]
-skip-if = (toolkit == 'gonk' && debug) #debug-only failure
[test_bug_795164.html]
[test_install_receipts.html]
[test_packaged_app_common.js]
[test_packaged_app_install.html]
-skip-if = (toolkit == 'gonk' && debug) #debug-only failure
[test_packaged_app_update.html]
-skip-if = toolkit=='gonk' # b2g(bug 915879) b2g-debug(debug-only timeout)
[test_receipt_operations.html]
[test_signed_pkg_install.html]
[test_uninstall_errors.html]
-skip-if = (toolkit == 'gonk' && debug) #debug-only timeout
diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp
index 3519cf01fc6a..1035ce1590e3 100644
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -251,12 +251,21 @@ TextureClient::GetIPDLActor()
#ifdef MOZ_WIDGET_GONK
static bool
-DisableGralloc(SurfaceFormat aFormat)
+DisableGralloc(SurfaceFormat aFormat, const gfx::IntSize& aSizeHint)
{
if (aFormat == gfx::SurfaceFormat::A8) {
return true;
}
+#if ANDROID_VERSION <= 15
+ // Adreno 200 has a problem of drawing gralloc buffer width less than 64 and
+ // drawing gralloc buffer with a height 9px-16px.
+ // See Bug 983971.
+ if (aSizeHint.width < 64 || aSizeHint.height < 32) {
+ return true;
+ }
+#endif
+
return false;
}
#endif
@@ -325,7 +334,7 @@ TextureClient::CreateTextureClientForDrawing(ISurfaceAllocator* aAllocator,
#endif
#ifdef MOZ_WIDGET_GONK
- if (!DisableGralloc(aFormat)) {
+ if (!DisableGralloc(aFormat, aSizeHint)) {
// Don't allow Gralloc texture clients to exceed the maximum texture size.
// BufferTextureClients have code to handle tiling the surface client-side.
int32_t maxTextureSize = aAllocator->GetMaxTextureSize();