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