--- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java Thu Dec 24 09:07:50 2015 -0800
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java Tue Dec 29 16:41:34 2015 +0300
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -955,6 +955,12 @@
{
comp = CompositeType.SrcNoEa;
}
+ if (srcData == dstData && sx == dx && sy == dy
+ && CompositeType.SrcNoEa.equals(comp)) {
+ // Performance optimization. We skip the Blit/BlitBG if we know that
+ // it will be noop.
+ return;
+ }
if (!isBgOperation(srcData, bgColor)) {
Blit blit = Blit.getFromCache(srcType, comp, dstType);
blit.Blit(srcData, dstData, sg.composite, clipRegion,