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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2001, 2013, 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, 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
*** 308,331 **** } } return false; } ! /* ! * Return a BufferedImage of the requested type with the indicated ! * subimage of the original image located at 0,0 in the new image. ! * If a bgColor is supplied, composite the original image over that ! * color with a SrcOver operation, otherwise make a SrcNoEa copy. */ BufferedImage makeBufferedImage(Image img, Color bgColor, int type, int sx1, int sy1, int sx2, int sy2) { final int width = sx2 - sx1; final int height = sy2 - sy1; final BufferedImage bimg = new BufferedImage(width, height, type); final SunGraphics2D g2d = (SunGraphics2D) bimg.createGraphics(); g2d.setComposite(AlphaComposite.Src); if (bgColor != null) { g2d.setColor(bgColor); g2d.fillRect(0, 0, width, height); g2d.setComposite(AlphaComposite.SrcOver); } --- 308,332 ---- } } return false; } ! /** ! * Return a non-accelerated BufferedImage of the requested type with the ! * indicated subimage of the original image located at 0,0 in the new image. ! * If a bgColor is supplied, composite the original image over that color ! * with a SrcOver operation, otherwise make a SrcNoEa copy. */ BufferedImage makeBufferedImage(Image img, Color bgColor, int type, int sx1, int sy1, int sx2, int sy2) { final int width = sx2 - sx1; final int height = sy2 - sy1; final BufferedImage bimg = new BufferedImage(width, height, type); final SunGraphics2D g2d = (SunGraphics2D) bimg.createGraphics(); g2d.setComposite(AlphaComposite.Src); + bimg.setAccelerationPriority(0); if (bgColor != null) { g2d.setColor(bgColor); g2d.fillRect(0, 0, width, height); g2d.setComposite(AlphaComposite.SrcOver); }