Bug 1239743: Do not allow windows to be resized to sizes above the maximum texture size. We don't know how to draw to these anyway. r=jimm

--HG--
extra : rebase_source : f1ad0237a72178fb1870bd23ae1aacd098ad995f
This commit is contained in:
Bas Schouten 2016-01-14 21:17:13 +01:00
Родитель f52b4c55e1
Коммит cb06edf308
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -189,6 +189,7 @@
#include "mozilla/layers/APZCTreeManager.h"
#include "mozilla/layers/InputAPZContext.h"
#include "ClientLayerManager.h"
#include "InputData.h"
#include "mozilla/Telemetry.h"
@ -1410,6 +1411,20 @@ nsWindow::SetSizeConstraints(const SizeConstraints& aConstraints)
c.mMinSize.width = std::max(int32_t(::GetSystemMetrics(SM_CXMINTRACK)), c.mMinSize.width);
c.mMinSize.height = std::max(int32_t(::GetSystemMetrics(SM_CYMINTRACK)), c.mMinSize.height);
}
ClientLayerManager *clientLayerManager =
(GetLayerManager()->GetBackendType() == LayersBackend::LAYERS_CLIENT)
? static_cast<ClientLayerManager*>(GetLayerManager())
: nullptr;
if (clientLayerManager) {
int32_t maxSize = clientLayerManager->GetMaxTextureSize();
// We can't make ThebesLayers bigger than this anyway.. no point it letting
// a window grow bigger as we won't be able to draw content there in
// general.
c.mMaxSize.width = std::min(c.mMaxSize.width, maxSize);
c.mMaxSize.height = std::min(c.mMaxSize.height, maxSize);
}
mSizeConstraintsScale = GetDefaultScale().scale;
nsBaseWidget::SetSizeConstraints(c);