jdk/src/windows/classes/sun/java2d/d3d/D3DPaints.java
changeset 16734 da1901d79073
parent 12813 c10ab96dcf41
child 22567 5816a47fa4dd
equal deleted inserted replaced
16733:9267ec7004a1 16734:da1901d79073
     1 /*
     1 /*
     2  * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    31 import java.awt.MultipleGradientPaint.CycleMethod;
    31 import java.awt.MultipleGradientPaint.CycleMethod;
    32 import java.awt.TexturePaint;
    32 import java.awt.TexturePaint;
    33 import java.awt.image.BufferedImage;
    33 import java.awt.image.BufferedImage;
    34 import java.util.HashMap;
    34 import java.util.HashMap;
    35 import java.util.Map;
    35 import java.util.Map;
    36 import javax.tools.annotation.GenerateNativeHeader;
    36 import java.lang.annotation.Native;
    37 import sun.java2d.SunGraphics2D;
    37 import sun.java2d.SunGraphics2D;
    38 import sun.java2d.SurfaceData;
    38 import sun.java2d.SurfaceData;
    39 import sun.java2d.loops.CompositeType;
    39 import sun.java2d.loops.CompositeType;
    40 import static sun.java2d.d3d.D3DContext.D3DContextCaps.*;
    40 import static sun.java2d.d3d.D3DContext.D3DContextCaps.*;
    41 
    41 
   156         }
   156         }
   157     }
   157     }
   158 
   158 
   159 /****************** Shared MultipleGradientPaint support ********************/
   159 /****************** Shared MultipleGradientPaint support ********************/
   160 
   160 
   161     /* No native methods here, but the constants are needed in the supporting JNI code */
       
   162     @GenerateNativeHeader
       
   163     private static abstract class MultiGradient extends D3DPaints {
   161     private static abstract class MultiGradient extends D3DPaints {
   164 
   162 
   165         /**
   163         /**
   166          * Note that this number is lower than the MULTI_MAX_FRACTIONS
   164          * Note that this number is lower than the MULTI_MAX_FRACTIONS
   167          * defined in the superclass.  The D3D pipeline now uses a
   165          * defined in the superclass.  The D3D pipeline now uses a
   168          * slightly more complicated shader (to avoid the gradient banding
   166          * slightly more complicated shader (to avoid the gradient banding
   169          * issues), which has a higher instruction count.  To ensure that
   167          * issues), which has a higher instruction count.  To ensure that
   170          * all versions of the shader can be compiled for PS 2.0 hardware,
   168          * all versions of the shader can be compiled for PS 2.0 hardware,
   171          * we need to cap this maximum value at 8.
   169          * we need to cap this maximum value at 8.
   172          */
   170          */
   173         public static final int MULTI_MAX_FRACTIONS_D3D = 8;
   171     @Native public static final int MULTI_MAX_FRACTIONS_D3D = 8;
   174 
   172 
   175         protected MultiGradient() {}
   173         protected MultiGradient() {}
   176 
   174 
   177         /**
   175         /**
   178          * Returns true if the given MultipleGradientPaint instance can be
   176          * Returns true if the given MultipleGradientPaint instance can be