src/share/classes/sun/awt/image/BufImgSurfaceData.java

Print this page


   1 /*
   2  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  28 import java.awt.Color;
  29 import java.awt.Rectangle;
  30 import java.awt.GraphicsConfiguration;
  31 import java.awt.image.ColorModel;
  32 import java.awt.image.SampleModel;
  33 import java.awt.image.DirectColorModel;
  34 import java.awt.image.IndexColorModel;
  35 import java.awt.image.Raster;
  36 import java.awt.image.BufferedImage;
  37 import java.awt.image.DataBuffer;
  38 
  39 import sun.java2d.SurfaceData;
  40 import sun.java2d.SunGraphics2D;
  41 import sun.java2d.StateTrackable;
  42 import sun.java2d.StateTrackable.*;
  43 import sun.java2d.StateTracker;
  44 import sun.java2d.loops.SurfaceType;
  45 import sun.java2d.loops.CompositeType;
  46 import sun.java2d.loops.RenderLoops;
  47 
  48 import javax.tools.annotation.GenerateNativeHeader;
  49 
  50 /* No native methods here, but the constants are needed in the supporting JNI code */
  51 @GenerateNativeHeader
  52 public class BufImgSurfaceData extends SurfaceData {
  53     BufferedImage bufImg;
  54     private BufferedImageGraphicsConfig graphicsConfig;
  55     RenderLoops solidloops;
  56 
  57     private static native void initIDs(Class ICM, Class ICMColorData);
  58 
  59     private static final int DCM_RGBX_RED_MASK   = 0xff000000;
  60     private static final int DCM_RGBX_GREEN_MASK = 0x00ff0000;
  61     private static final int DCM_RGBX_BLUE_MASK  = 0x0000ff00;
  62     private static final int DCM_555X_RED_MASK = 0xF800;
  63     private static final int DCM_555X_GREEN_MASK = 0x07C0;
  64     private static final int DCM_555X_BLUE_MASK = 0x003E;
  65     private static final int DCM_4444_RED_MASK   = 0x0f00;
  66     private static final int DCM_4444_GREEN_MASK = 0x00f0;
  67     private static final int DCM_4444_BLUE_MASK  = 0x000f;
  68     private static final int DCM_4444_ALPHA_MASK = 0xf000;
  69     private static final int DCM_ARGBBM_ALPHA_MASK = 0x01000000;
  70     private static final int DCM_ARGBBM_RED_MASK   = 0x00ff0000;
  71     private static final int DCM_ARGBBM_GREEN_MASK = 0x0000ff00;


   1 /*
   2  * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  28 import java.awt.Color;
  29 import java.awt.Rectangle;
  30 import java.awt.GraphicsConfiguration;
  31 import java.awt.image.ColorModel;
  32 import java.awt.image.SampleModel;
  33 import java.awt.image.DirectColorModel;
  34 import java.awt.image.IndexColorModel;
  35 import java.awt.image.Raster;
  36 import java.awt.image.BufferedImage;
  37 import java.awt.image.DataBuffer;
  38 
  39 import sun.java2d.SurfaceData;
  40 import sun.java2d.SunGraphics2D;
  41 import sun.java2d.StateTrackable;
  42 import sun.java2d.StateTrackable.*;
  43 import sun.java2d.StateTracker;
  44 import sun.java2d.loops.SurfaceType;
  45 import sun.java2d.loops.CompositeType;
  46 import sun.java2d.loops.RenderLoops;
  47 

  48 


  49 public class BufImgSurfaceData extends SurfaceData {
  50     BufferedImage bufImg;
  51     private BufferedImageGraphicsConfig graphicsConfig;
  52     RenderLoops solidloops;
  53 
  54     private static native void initIDs(Class ICM, Class ICMColorData);
  55 
  56     private static final int DCM_RGBX_RED_MASK   = 0xff000000;
  57     private static final int DCM_RGBX_GREEN_MASK = 0x00ff0000;
  58     private static final int DCM_RGBX_BLUE_MASK  = 0x0000ff00;
  59     private static final int DCM_555X_RED_MASK = 0xF800;
  60     private static final int DCM_555X_GREEN_MASK = 0x07C0;
  61     private static final int DCM_555X_BLUE_MASK = 0x003E;
  62     private static final int DCM_4444_RED_MASK   = 0x0f00;
  63     private static final int DCM_4444_GREEN_MASK = 0x00f0;
  64     private static final int DCM_4444_BLUE_MASK  = 0x000f;
  65     private static final int DCM_4444_ALPHA_MASK = 0xf000;
  66     private static final int DCM_ARGBBM_ALPHA_MASK = 0x01000000;
  67     private static final int DCM_ARGBBM_RED_MASK   = 0x00ff0000;
  68     private static final int DCM_ARGBBM_GREEN_MASK = 0x0000ff00;