diff options
author | Philip Jordan <[email protected]> | 2020-02-18 20:02:31 +1300 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-18 20:02:31 +1300 |
commit | c9efc71a7d983d8753ca34ad7fce5022924d1a5c (patch) | |
tree | 1bf2c0617858e248837e518a33f3b240a992dfe8 | |
parent | 25a9cd6c19968034cc311a76c2065cdd0b4789b6 (diff) | |
parent | c6d5c540f605735c4e121d6cc245572baca0101f (diff) |
Merge pull request #10 from etsinko/read-raster-hidpi-fix
HiDPI fix for Raster reading operation
-rw-r--r-- | src/main/java/org/jogamp/java3d/Canvas3D.java | 4 | ||||
-rw-r--r-- | src/main/java/org/jogamp/java3d/GraphicsContext3D.java | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/org/jogamp/java3d/Canvas3D.java b/src/main/java/org/jogamp/java3d/Canvas3D.java index 55dbab9..9188ae0 100644 --- a/src/main/java/org/jogamp/java3d/Canvas3D.java +++ b/src/main/java/org/jogamp/java3d/Canvas3D.java @@ -2848,7 +2848,7 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine /** * Retreives the width of the canvas in device pixels (regardless of HIDPI scale) */ - int getPixelWidth() { + public int getPixelWidth() { if (canvasViewCache != null) { synchronized (canvasViewCache) { return canvasViewCache.getCanvasWidth(); @@ -2860,7 +2860,7 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine /** * Retreives the height of the canvas in device pixels (regardless of HIDPI scale) */ - int getPixelHeight() { + public int getPixelHeight() { if (canvasViewCache != null) { synchronized (canvasViewCache) { return canvasViewCache.getCanvasHeight(); diff --git a/src/main/java/org/jogamp/java3d/GraphicsContext3D.java b/src/main/java/org/jogamp/java3d/GraphicsContext3D.java index c2c43f9..6844b95 100644 --- a/src/main/java/org/jogamp/java3d/GraphicsContext3D.java +++ b/src/main/java/org/jogamp/java3d/GraphicsContext3D.java @@ -2255,7 +2255,6 @@ public int numSounds() { } RasterRetained ras = (RasterRetained)raster.retained; - Dimension canvasSize = canvas3d.getSize(); Dimension rasterSize = new Dimension(); ImageComponent2DRetained image = ras.image; @@ -2348,7 +2347,7 @@ public int numSounds() { Pipeline.getPipeline().readRaster(canvas3d.ctx, ras.type, rasterSrcOffset.x, rasterSrcOffset.y, - rasterSize.width, rasterSize.height, canvasSize.height, + rasterSize.width, rasterSize.height, canvas3d.getPixelHeight(), imageDataType, imageFormatType, imageBuffer, |