1 /* 2 * Copyright (c) 2019, 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 MTLRenderer_h_Included 27 #define MTLRenderer_h_Included 28 29 #include "sun_java2d_pipe_BufferedRenderPipe.h" 30 #include "MTLContext.h" 31 #include "MTLGraphicsConfig.h" 32 #import "MTLLayer.h" 33 34 #define BYTES_PER_POLY_POINT \ 35 sun_java2d_pipe_BufferedRenderPipe_BYTES_PER_POLY_POINT 36 #define BYTES_PER_SCANLINE \ 37 sun_java2d_pipe_BufferedRenderPipe_BYTES_PER_SCANLINE 38 #define BYTES_PER_SPAN \ 39 sun_java2d_pipe_BufferedRenderPipe_BYTES_PER_SPAN 40 41 void MTLRenderer_DrawLine(MTLContext *mtlc, BMTLSDOps * dstOps, 42 jint x1, jint y1, jint x2, jint y2); 43 void MTLRenderer_DrawRect(MTLContext *mtlc, BMTLSDOps * dstOps, 44 jint x, jint y, jint w, jint h); 45 void MTLRenderer_DrawPoly(MTLContext *mtlc, BMTLSDOps * dstOps, 46 jint nPoints, jint isClosed, 47 jint transX, jint transY, 48 jint *xPoints, jint *yPoints); 49 void MTLRenderer_DrawScanlines(MTLContext *mtlc, BMTLSDOps * dstOps, 50 jint count, jint *scanlines); 51 void MTLRenderer_DrawParallelogram(MTLContext *mtlc, BMTLSDOps * dstOps, 52 jfloat fx11, jfloat fy11, 53 jfloat dx21, jfloat dy21, 54 jfloat dx12, jfloat dy12, 55 jfloat lw21, jfloat lw12); 56 void MTLRenderer_DrawAAParallelogram(MTLContext *mtlc, BMTLSDOps *dstOps, 57 jfloat fx11, jfloat fy11, 58 jfloat dx21, jfloat dy21, 59 jfloat dx12, jfloat dy12, 60 jfloat lw21, jfloat lw12); 61 62 void MTLRenderer_FillRect(MTLContext *mtlc, BMTLSDOps * dstOps, 63 jint x, jint y, jint w, jint h); 64 void MTLRenderer_FillSpans(MTLContext *mtlc, BMTLSDOps * dstOps, 65 jint count, jint *spans); 66 void MTLRenderer_FillParallelogram(MTLContext *mtlc, BMTLSDOps * dstOps, 67 jfloat fx11, jfloat fy11, 68 jfloat dx21, jfloat dy21, 69 jfloat dx12, jfloat dy12); 70 void MTLRenderer_FillAAParallelogram(MTLContext *mtlc, BMTLSDOps *dstOps, 71 jfloat fx11, jfloat fy11, 72 jfloat dx21, jfloat dy21, 73 jfloat dx12, jfloat dy12); 74 75 void MTLRenderer_EnableAAParallelogramProgram(); 76 void MTLRenderer_DisableAAParallelogramProgram(); 77 78 #endif /* MTLRenderer_h_Included */