Bug 1210351 - Limit maximum computed tile size to 512x512. r=snorp
authorJamie Nicol <jnicol@mozilla.com>
Thu, 22 Oct 2015 17:08:51 +0100
changeset 304655 51036998fbc8f650a2e8d6800b53ed58ab7887ad
parent 304654 11b00fe66b650d05fece9f81833ca0603455bd01
child 304656 3bfb54d60c859c73a3c1862d7cec519a60614aff
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1210351
milestone44.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
Bug 1210351 - Limit maximum computed tile size to 512x512. r=snorp Larger tiles than that were causing some performance regressions and increased memory usage, so are not deemed worthwhile.
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -1055,19 +1055,21 @@ gfxPlatform::ComputeTileSize()
   }
 
   int32_t w = gfxPrefs::LayersTileWidth();
   int32_t h = gfxPrefs::LayersTileHeight();
 
   if (gfxPrefs::LayersTilesAdjust()) {
     gfx::IntSize screenSize = GetScreenSize();
     if (screenSize.width > 0) {
-      // FIXME: we should probably make sure this is within the max texture size,
-      // but I think everything should at least support 1024
-      w = h = std::max(std::min(NextPowerOfTwo(screenSize.width) / 2, 1024), 256);
+      // For the time being tiles larger than 512 probably do not make much
+      // sense. This is due to e.g. increased rasterisation time outweighing
+      // the decreased composition time, or large increases in memory usage
+      // for screens slightly wider than a higher power of two.
+      w = h = screenSize.width >= 512 ? 512 : 256;
     }
 
 #ifdef MOZ_WIDGET_GONK
     android::sp<android::GraphicBuffer> alloc =
           new android::GraphicBuffer(w, h, android::PIXEL_FORMAT_RGBA_8888,
                                      android::GraphicBuffer::USAGE_SW_READ_OFTEN |
                                      android::GraphicBuffer::USAGE_SW_WRITE_OFTEN |
                                      android::GraphicBuffer::USAGE_HW_TEXTURE);