jdk/src/share/classes/sun/java2d/pipe/BufferedTextPipe.java
changeset 16734 da1901d79073
parent 12813 c10ab96dcf41
child 21278 ef8a3a2a72f2
equal deleted inserted replaced
16733:9267ec7004a1 16734:da1901d79073
     1 /*
     1 /*
     2  * Copyright (c) 2007, 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
    30 import sun.font.GlyphList;
    30 import sun.font.GlyphList;
    31 import sun.java2d.SunGraphics2D;
    31 import sun.java2d.SunGraphics2D;
    32 import sun.java2d.SurfaceData;
    32 import sun.java2d.SurfaceData;
    33 import static sun.java2d.pipe.BufferedOpCodes.*;
    33 import static sun.java2d.pipe.BufferedOpCodes.*;
    34 
    34 
    35 import javax.tools.annotation.GenerateNativeHeader;
    35 import java.lang.annotation.Native;
    36 
    36 
    37 /* No native methods here, but the constants are needed in the supporting JNI code */
       
    38 @GenerateNativeHeader
       
    39 public abstract class BufferedTextPipe extends GlyphListPipe {
    37 public abstract class BufferedTextPipe extends GlyphListPipe {
    40 
    38 
    41     private static final int BYTES_PER_GLYPH_IMAGE = 8;
    39     @Native private static final int BYTES_PER_GLYPH_IMAGE = 8;
    42     private static final int BYTES_PER_GLYPH_POSITION = 8;
    40     @Native private static final int BYTES_PER_GLYPH_POSITION = 8;
    43 
    41 
    44     /**
    42     /**
    45      * The following offsets are used to pack the parameters in
    43      * The following offsets are used to pack the parameters in
    46      * createPackedParams().  (They are also used at the native level when
    44      * createPackedParams().  (They are also used at the native level when
    47      * unpacking the params.)
    45      * unpacking the params.)
    48      */
    46      */
    49     private static final int OFFSET_CONTRAST  = 8;
    47     @Native private static final int OFFSET_CONTRAST  = 8;
    50     private static final int OFFSET_RGBORDER  = 2;
    48     @Native private static final int OFFSET_RGBORDER  = 2;
    51     private static final int OFFSET_SUBPIXPOS = 1;
    49     @Native private static final int OFFSET_SUBPIXPOS = 1;
    52     private static final int OFFSET_POSITIONS = 0;
    50     @Native private static final int OFFSET_POSITIONS = 0;
    53 
    51 
    54     /**
    52     /**
    55      * Packs the given parameters into a single int value in order to save
    53      * Packs the given parameters into a single int value in order to save
    56      * space on the rendering queue.  Note that most of these parameters
    54      * space on the rendering queue.  Note that most of these parameters
    57      * are only used for rendering LCD-optimized text, but conditionalizing
    55      * are only used for rendering LCD-optimized text, but conditionalizing