< prev index next >

src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2001, 2014, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 952,961 **** --- 952,967 ---- (bgColor != null && bgColor.getTransparency() == Transparency.OPAQUE))) { 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, sx, sy, dx, dy, w, h); } else {
< prev index next >