JDK-8163795 : [Windows] Remove call to StretchBlt in native GetScreenCapture method
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-08-10
  • Updated: 2018-05-18
  • Resolved: 2018-05-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
openjfx11Fixed
Related Reports
Blocks :  
Description
After the fix for JDK-8162783 the native GetScreenCapture method in the Windows glass Robot.cpp code is only ever called with the same values for src and dst size. This means that the code path that calls StretchBlt is no longer used and can be removed, along with changing the arguments to the function to only take in a single pair of width and height values.
Comments
Changeset: c2b8061b5fe4 Author: pbansal Date: 2018-05-15 17:13 -0700 URL: http://hg.openjdk.java.net/openjfx/jfx-dev/rt/rev/c2b8061b5fe4 8163795: [Windows] Remove call to StretchBlt in native GetScreenCapture method Reviewed-by: kcr
16-05-2018

+1
15-05-2018

Hi Kevin, Request to review the fix for this issue. Webrev: http://cr.openjdk.java.net/~pbansal/8163795/webrev.00/ Its small fix to remove some code as it is not being called from anywhere. It became a dead code after the fix for JDK-8162783. Just to be sure, I have run all the tests including System tests and Unit tests for all the modules and things look good.
15-05-2018

The following are the only two calls to this method: GetScreenCapture(dx, dy, 1, 1, &val, 1, 1); GetScreenCapture(x, y, width, height, pixelData, width, height); The following obsolete code path can be removed: if (retw == devw && reth == devh) { ::BitBlt(hdcMem, 0, 0, retw, reth, hdcScreen, x, y, dwRop); } else { ::StretchBlt(hdcMem, 0, 0, retw, reth, hdcScreen, x, y, devw, devh, dwRop); } And replaced with: ::BitBlt(hdcMem, 0, 0, width, height, hdcScreen, x, y, dwRop); (after replacing the two pairs of width,height values with a single pair, suitably named)
10-08-2016