< prev index next >

src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.h

Print this page


   1 /*
   2  * Copyright (c) 2000, 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
  23  * questions.
  24  */
  25 
  26 #ifndef GraphicsPrimitiveMgr_h_Included
  27 #define GraphicsPrimitiveMgr_h_Included
  28 
  29 #ifdef __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #include <stddef.h>

  34 
  35 #include "java_awt_AlphaComposite.h"
  36 
  37 #include "SurfaceData.h"
  38 #include "SpanIterator.h"
  39 
  40 #include "j2d_md.h"
  41 
  42 #include "AlphaMath.h"
  43 #include "GlyphImageRef.h"
  44 
  45 /*
  46  * This structure contains all of the information about a particular
  47  * type of GraphicsPrimitive, such as a FillRect, a MaskFill, or a Blit.
  48  *
  49  * A global collection of these structures is declared and initialized
  50  * to contain the necessary Java (JNI) information so that appropriate
  51  * Java GraphicsPrimitive objects can be quickly constructed for a set
  52  * of native loops simply by referencing the necessary entry from that
  53  * collection for the type of primitive being registered.


 534  * Data structure and functions to retrieve and use
 535  * AffineTransform objects from the native level.
 536  */
 537 typedef struct {
 538     jdouble dxdx;       /* dx in dest space for each dx in src space */
 539     jdouble dxdy;       /* dx in dest space for each dy in src space */
 540     jdouble tx;
 541     jdouble dydx;       /* dy in dest space for each dx in src space */
 542     jdouble dydy;       /* dy in dest space for each dy in src space */
 543     jdouble ty;
 544 } TransformInfo;
 545 
 546 extern JNIEXPORT void JNICALL
 547 Transform_GetInfo(JNIEnv *env, jobject txform, TransformInfo *pTxInfo);
 548 extern JNIEXPORT void JNICALL
 549 Transform_transform(TransformInfo *pTxInfo, jdouble *pX, jdouble *pY);
 550 
 551 void GrPrim_RefineBounds(SurfaceDataBounds *bounds, jint transX, jint transY,
 552                          jfloat *coords,  jint maxCoords);
 553 
 554 extern jfieldID path2DTypesID;
 555 extern jfieldID path2DNumTypesID;
 556 extern jfieldID path2DWindingRuleID;
 557 extern jfieldID path2DFloatCoordsID;
 558 extern jfieldID sg2dStrokeHintID;
 559 extern jint sunHints_INTVAL_STROKE_PURE;
 560 
 561 /*
 562  * Macros for using jlong variables as 32bits.32bits fractional values
 563  */
 564 #define LongOneHalf     (((jlong) 1) << 31)
 565 #define IntToLong(i)    (((jlong) (i)) << 32)
 566 #define DblToLong(d)    ((jlong) ((d) * IntToLong(1)))
 567 #define LongToDbl(l)    (((jdouble) l) / IntToLong(1))
 568 #define WholeOfLong(l)  ((jint) ((l) >> 32))
 569 #define FractOfLong(l)  ((jint) (l))
 570 #define URShift(i, n)   (((juint) (i)) >> (n))
 571 
 572 /*
 573  * Macros to help in defining arrays of NativePrimitive structures.
 574  *
 575  * These macros are the very base macros.  More specific macros are
 576  * defined in LoopMacros.h.
 577  *
 578  * Note that the DrawLine, DrawRect, and DrawPolygons primitives are
 579  * all registered together from a single shared native function pointer.


   1 /*
   2  * Copyright (c) 2000, 2018, 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
  23  * questions.
  24  */
  25 
  26 #ifndef GraphicsPrimitiveMgr_h_Included
  27 #define GraphicsPrimitiveMgr_h_Included
  28 
  29 #ifdef __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #include <stddef.h>
  34 #include "jni.h"
  35 
  36 #include "java_awt_AlphaComposite.h"
  37 
  38 #include "SurfaceData.h"
  39 #include "SpanIterator.h"
  40 
  41 #include "j2d_md.h"
  42 
  43 #include "AlphaMath.h"
  44 #include "GlyphImageRef.h"
  45 
  46 /*
  47  * This structure contains all of the information about a particular
  48  * type of GraphicsPrimitive, such as a FillRect, a MaskFill, or a Blit.
  49  *
  50  * A global collection of these structures is declared and initialized
  51  * to contain the necessary Java (JNI) information so that appropriate
  52  * Java GraphicsPrimitive objects can be quickly constructed for a set
  53  * of native loops simply by referencing the necessary entry from that
  54  * collection for the type of primitive being registered.


 535  * Data structure and functions to retrieve and use
 536  * AffineTransform objects from the native level.
 537  */
 538 typedef struct {
 539     jdouble dxdx;       /* dx in dest space for each dx in src space */
 540     jdouble dxdy;       /* dx in dest space for each dy in src space */
 541     jdouble tx;
 542     jdouble dydx;       /* dy in dest space for each dx in src space */
 543     jdouble dydy;       /* dy in dest space for each dy in src space */
 544     jdouble ty;
 545 } TransformInfo;
 546 
 547 extern JNIEXPORT void JNICALL
 548 Transform_GetInfo(JNIEnv *env, jobject txform, TransformInfo *pTxInfo);
 549 extern JNIEXPORT void JNICALL
 550 Transform_transform(TransformInfo *pTxInfo, jdouble *pX, jdouble *pY);
 551 
 552 void GrPrim_RefineBounds(SurfaceDataBounds *bounds, jint transX, jint transY,
 553                          jfloat *coords,  jint maxCoords);
 554 
 555 JNIEXPORT extern jfieldID path2DTypesID;
 556 JNIEXPORT extern jfieldID path2DNumTypesID;
 557 JNIEXPORT extern jfieldID path2DWindingRuleID;
 558 JNIEXPORT extern jfieldID path2DFloatCoordsID;
 559 JNIEXPORT extern jfieldID sg2dStrokeHintID;
 560 JNIEXPORT extern jint sunHints_INTVAL_STROKE_PURE;
 561 
 562 /*
 563  * Macros for using jlong variables as 32bits.32bits fractional values
 564  */
 565 #define LongOneHalf     (((jlong) 1) << 31)
 566 #define IntToLong(i)    (((jlong) (i)) << 32)
 567 #define DblToLong(d)    ((jlong) ((d) * IntToLong(1)))
 568 #define LongToDbl(l)    (((jdouble) l) / IntToLong(1))
 569 #define WholeOfLong(l)  ((jint) ((l) >> 32))
 570 #define FractOfLong(l)  ((jint) (l))
 571 #define URShift(i, n)   (((juint) (i)) >> (n))
 572 
 573 /*
 574  * Macros to help in defining arrays of NativePrimitive structures.
 575  *
 576  * These macros are the very base macros.  More specific macros are
 577  * defined in LoopMacros.h.
 578  *
 579  * Note that the DrawLine, DrawRect, and DrawPolygons primitives are
 580  * all registered together from a single shared native function pointer.


< prev index next >