[OpenJDK 2D-Dev] RFR: 8252070: Some platform-specific BLIT optimizations are not effective

Sergey Bylokhov serb at openjdk.java.net
Thu Sep 10 22:54:46 UTC 2020

Some of our code assumes that the native system(XRender, D3D, OGL) makes some
effective optimizations, but in some cases, we can do better.

One of the areas for improvement is direct blitting. If the source is much
bigger than the destination we should not try to copy to the non-existent area
and could cut coordinates accordingly.

The actual change is:
  951         Rectangle dst =
  952                 new Rectangle(dx, dy, w, h).intersection(dstData.getBounds());
  953         if (dst.isEmpty()) {
  972                 // return
  975         }
  979         sx += dst.x - dx;
  980         sy += dst.y - dy;

See performance data and some additional comments:

The old review request:


Commit messages:
 - 8252070: Some platform-specific BLIT optimizations are not effective

Changes: https://git.openjdk.java.net/jdk/pull/121/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=121&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8252070
  Stats: 81 lines in 1 file changed: 42 ins; 28 del; 11 mod
  Patch: https://git.openjdk.java.net/jdk/pull/121.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/121/head:pull/121

PR: https://git.openjdk.java.net/jdk/pull/121

More information about the 2d-dev mailing list