зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
f52b4c55e1
Коммит
cb06edf308
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче