--- old/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java 2016-12-07 10:36:29.194841289 +0530 +++ new/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java 2016-12-07 10:36:29.042841289 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -174,7 +174,7 @@ @Override public int getRGBPixel(int x, int y) { int c[] = new int[1]; - getScreenPixels(new Rectangle(x, y, 1, 1), c); + getScreenPixels(new Rectangle(x, y, 1, 1), 1, c); return c[0]; } @@ -186,7 +186,8 @@ @Override public int [] getRGBPixels(final Rectangle bounds) { int c[] = new int[bounds.width * bounds.height]; - getScreenPixels(bounds, c); + double scale = fDevice.getScaleFactor(); + getScreenPixels(bounds, scale, c); return c; } @@ -197,8 +198,8 @@ boolean isButtonsDownState, boolean isMouseMove); private native void keyEvent(int javaKeyCode, boolean keydown); - private void getScreenPixels(Rectangle r, int[] pixels){ - nativeGetScreenPixels(r.x, r.y, r.width, r.height, pixels); + private void getScreenPixels(Rectangle r, double scale, int[] pixels){ + nativeGetScreenPixels(r.x, r.y, r.width, r.height, scale, pixels); } - private native void nativeGetScreenPixels(int x, int y, int width, int height, int[] pixels); + private native void nativeGetScreenPixels(int x, int y, int width, int height, double scale, int[] pixels); }