modules/graphics/src/main/java/com/sun/prism/es2/ES2SwapChain.java
Print this page
@@ -44,11 +44,12 @@
// On screen
private GLDrawable drawable;
private boolean needsResize;
private boolean opaque = false;
private int w, h;
- private float pixelScaleFactor;
+ private float pixelScaleFactorX;
+ private float pixelScaleFactorY;
// a value of zero corresponds to the windowing system-provided
// framebuffer object
int nativeDestHandle = 0;
private final boolean msaa;
/**
@@ -85,19 +86,23 @@
}
ES2SwapChain(ES2Context context, PresentableState pState) {
this.context = context;
this.pState = pState;
- this.pixelScaleFactor = pState.getRenderScale();
+ this.pixelScaleFactorX = pState.getRenderScaleX();
+ this.pixelScaleFactorY = pState.getRenderScaleY();
this.msaa = pState.isMSAA();
long nativeWindow = pState.getNativeWindow();
drawable = ES2Pipeline.glFactory.createGLDrawable(
nativeWindow, context.getPixelFormat());
}
public boolean lockResources(PresentableState pState) {
- if (this.pState != pState || pixelScaleFactor != pState.getRenderScale()) {
+ if (this.pState != pState ||
+ pixelScaleFactorX != pState.getRenderScaleX() ||
+ pixelScaleFactorY != pState.getRenderScaleY())
+ {
return true;
}
needsResize = (w != pState.getRenderWidth() || h != pState.getRenderHeight());
// the stableBackbuffer will be used as the render target
if (stableBackbuffer != null && !needsResize) {
@@ -218,11 +223,11 @@
stableBackbuffer.contentsUseful();
}
copyFullBuffer = true;
}
ES2Graphics g = ES2Graphics.create(context, stableBackbuffer);
- g.scale(pixelScaleFactor, pixelScaleFactor);
+ g.scale(pixelScaleFactorX, pixelScaleFactorY);
return g;
}
public int getFboID() {
return nativeDestHandle;
@@ -267,12 +272,18 @@
public int getContentHeight() {
return pState.getOutputHeight();
}
- public float getPixelScaleFactor() {
- return pixelScaleFactor;
+ @Override
+ public float getPixelScaleFactorX() {
+ return pixelScaleFactorX;
+ }
+
+ @Override
+ public float getPixelScaleFactorY() {
+ return pixelScaleFactorY;
}
@Override
public void dispose() {
if (stableBackbuffer != null) {