mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 720613 - Prevent resizing before the surface has been created. r=pcwalton
Prevent trying to resize the buffer before the surface has been created. At that point, we wouldn't know our maximum texture size, so we would've thrown a RuntimeException.
This commit is contained in:
parent
ab9f951d91
commit
3e51ec6c57
@ -61,6 +61,10 @@ public class FloatSize {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() { return "(" + width + "," + height + ")"; }
|
public String toString() { return "(" + width + "," + height + ")"; }
|
||||||
|
|
||||||
|
public boolean isPositive() {
|
||||||
|
return (width > 0 && height > 0);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean fuzzyEquals(FloatSize size) {
|
public boolean fuzzyEquals(FloatSize size) {
|
||||||
return (FloatUtils.fuzzyEquals(size.width, width) &&
|
return (FloatUtils.fuzzyEquals(size.width, width) &&
|
||||||
FloatUtils.fuzzyEquals(size.height, height));
|
FloatUtils.fuzzyEquals(size.height, height));
|
||||||
|
@ -429,8 +429,14 @@ public class GeckoSoftwareLayerClient extends LayerClient implements GeckoEventL
|
|||||||
DisplayMetrics metrics = new DisplayMetrics();
|
DisplayMetrics metrics = new DisplayMetrics();
|
||||||
GeckoApp.mAppContext.getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
GeckoApp.mAppContext.getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||||
|
|
||||||
if (!force && metrics.widthPixels == mScreenSize.width &&
|
// Return immediately if the screen size hasn't changed or the viewport
|
||||||
metrics.heightPixels == mScreenSize.height) {
|
// size is zero (which indicates that the rendering surface hasn't been
|
||||||
|
// allocated yet).
|
||||||
|
boolean screenSizeChanged = (metrics.widthPixels != mScreenSize.width ||
|
||||||
|
metrics.heightPixels != mScreenSize.height);
|
||||||
|
boolean viewportSizeValid = (getLayerController() != null &&
|
||||||
|
getLayerController().getViewportSize().isPositive());
|
||||||
|
if (!(force || (screenSizeChanged && viewportSizeValid))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user