modules/graphics/src/main/java/com/sun/prism/d3d/D3DContext.java
Print this page
@@ -550,13 +550,14 @@
void renderMeshView(long nativeMeshView, Graphics g) {
// Support retina display by scaling the projViewTx and pass it to the shader.
scratchTx = scratchTx.set(projViewTx);
- float pixelScaleFactor = g.getPixelScaleFactor();
- if (pixelScaleFactor != 1.0) {
- scratchTx.scale(pixelScaleFactor, pixelScaleFactor, 1.0);
+ float pixelScaleFactorX = g.getPixelScaleFactorX();
+ float pixelScaleFactorY = g.getPixelScaleFactorY();
+ if (pixelScaleFactorX != 1.0 || pixelScaleFactorY != 1.0) {
+ scratchTx.scale(pixelScaleFactorX, pixelScaleFactorY, 1.0);
}
// Set projection view matrix
int res = nSetProjViewMatrix(pContext, g.isDepthTest(),
scratchTx.get(0), scratchTx.get(1), scratchTx.get(2), scratchTx.get(3),
@@ -569,14 +570,13 @@
validate(res);
// Undo the SwapChain scaling done in createGraphics() because 3D needs
// this information in the shader (via projViewTx)
BaseTransform xform = g.getTransformNoClone();
- if (pixelScaleFactor != 1.0) {
- float invPSF = 1 / pixelScaleFactor;
+ if (pixelScaleFactorX != 1.0 || pixelScaleFactorY != 1.0) {
scratchAffine3DTx.setToIdentity();
- scratchAffine3DTx.scale(invPSF, invPSF);
+ scratchAffine3DTx.scale(1.0 / pixelScaleFactorX, 1.0 / pixelScaleFactorY);
scratchAffine3DTx.concatenate(xform);
updateWorldTransform(scratchAffine3DTx);
} else {
updateWorldTransform(xform);
}