Bug 1428730 - Allow surfaces up to a width or height of 16384. r?bas
This reverts
bug 1417310, which confused the concepts of "reasonable"
and "allowed" surface size and set the max to the defined reasonable
limit of 8192. This is too low for 4k screens. We now go back to using
the correct variable ("allowed") for the maximum size, but reduce its
value from 32767 to 16384.
MozReview-Commit-ID: 6MsEIKlZvCq
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -238,30 +238,28 @@ ContentClient::BeginPaint(PaintedLayer*
// types, or we failed to unrotate the buffer when requested. In any case,
// we need to allocate a new one and prepare it for drawing.
if (!dest.mCanReuseBuffer) {
uint32_t bufferFlags = 0;
if (dest.mBufferMode == SurfaceMode::SURFACE_COMPONENT_ALPHA) {
bufferFlags |= BUFFER_COMPONENT_ALPHA;
}
- RefPtr<RotatedBuffer> newBuffer;
- if (Factory::ReasonableSurfaceSize(IntSize(dest.mBufferRect.Width(), dest.mBufferRect.Height()))) {
- newBuffer = CreateBuffer(result.mContentType, dest.mBufferRect, bufferFlags);
+ RefPtr<RotatedBuffer> newBuffer = CreateBuffer(result.mContentType,
+ dest.mBufferRect,
+ bufferFlags);
- if (!newBuffer) {
+ if (!newBuffer) {
+ if (Factory::ReasonableSurfaceSize(IntSize(dest.mBufferRect.Width(), dest.mBufferRect.Height()))) {
gfxCriticalNote << "Failed buffer for "
<< dest.mBufferRect.X() << ", "
<< dest.mBufferRect.Y() << ", "
<< dest.mBufferRect.Width() << ", "
<< dest.mBufferRect.Height();
}
- }
-
- if (!newBuffer) {
Clear();
return result;
}
if (!newBuffer->Lock(lockMode)) {
gfxCriticalNote << "Failed to lock new back buffer.";
Clear();
return result;
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -479,19 +479,19 @@ private:
// Note that "gfx.logging.level" is defined in Logging.h.
DECL_GFX_PREF(Live, "gfx.logging.level", GfxLoggingLevel, int32_t, mozilla::gfx::LOG_DEFAULT);
DECL_GFX_PREF(Once, "gfx.logging.crash.length", GfxLoggingCrashLength, uint32_t, 16);
DECL_GFX_PREF(Live, "gfx.logging.painted-pixel-count.enabled",GfxLoggingPaintedPixelCountEnabled, bool, false);
// The maximums here are quite conservative, we can tighten them if problems show up.
DECL_GFX_PREF(Once, "gfx.logging.texture-usage.enabled", GfxLoggingTextureUsageEnabled, bool, false);
DECL_GFX_PREF(Once, "gfx.logging.peak-texture-usage.enabled",GfxLoggingPeakTextureUsageEnabled, bool, false);
// Use gfxPlatform::MaxAllocSize instead of the pref directly
- DECL_GFX_PREF(Once, "gfx.max-alloc-size", MaxAllocSizeDoNotUseDirectly, int32_t, (int32_t)500000000);
+ DECL_GFX_PREF(Once, "gfx.max-alloc-size", MaxAllocSizeDoNotUseDirectly, int32_t, (int32_t)250000000);
// Use gfxPlatform::MaxTextureSize instead of the pref directly
- DECL_GFX_PREF(Once, "gfx.max-texture-size", MaxTextureSizeDoNotUseDirectly, int32_t, (int32_t)32767);
+ DECL_GFX_PREF(Once, "gfx.max-texture-size", MaxTextureSizeDoNotUseDirectly, int32_t, (int32_t)16384);
DECL_GFX_PREF(Live, "gfx.partialpresent.force", PartialPresent, int32_t, 0);
DECL_GFX_PREF(Live, "gfx.perf-warnings.enabled", PerfWarnings, bool, false);
DECL_GFX_PREF(Live, "gfx.testing.device-reset", DeviceResetForTesting, int32_t, 0);
DECL_GFX_PREF(Live, "gfx.testing.device-fail", DeviceFailForTesting, bool, false);
DECL_GFX_PREF(Once, "gfx.text.disable-aa", DisableAllTextAA, bool, false);
DECL_GFX_PREF(Live, "gfx.ycbcr.accurate-conversion", YCbCrAccurateConversion, bool, false);
// Disable surface sharing due to issues with compatible FBConfigs on