1 /* 2 * Copyright (c) 2010, 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 package sun.java2d.xr; 27 28 /** 29 * XRender pipeline backend interface. 30 * Currently there are two different backends implemented: 31 * - XRBackendNative: Native 1:1 binding with libX11. 32 * - XRBackendDeferred: Deferrs protocol submission, so that aa tiles 33 * can be submitted in one go. 34 */ 35 36 import java.awt.geom.*; 37 import java.util.*; 38 39 import sun.font.*; 40 import sun.java2d.pipe.*; 41 42 public interface XRBackend { 43 44 public void initResources(int parentXID); 45 46 public void freePicture(int picture); 47 48 public void freePixmap(int pixmap); 49 50 public int createPixmap(int drawable, int depth, int width, int height); 51 52 public int createPicture(int drawable, int formatID); 53 54 public long createGC(int drawable); 55 56 public void freeGC(long gc); /* TODO: Use!! */ 57 58 public void copyArea(int src, int dst, long gc, int srcx, int srcy, 59 int width, int height, int dstx, int dsty); 60 61 public void maskedComposite(byte op, int src, int eaMask, int dst, 62 int srcX, int srcY, int dstX, int dstY, int width, 63 int height, int maskScan, int maskOff, byte[] mask, float ea); 64 65 public void setGCClipRectangles(long gc, Region clip); 66 67 public void GCRectangles(int drawable, long gc, GrowableRectArray rects); 68 69 public void setClipRectangles(int picture, Region clip); 70 71 public void setGCExposures(long gc, boolean exposure); 72 73 public void setGCForeground(long gc, int pixel); 74 75 public void setPictureTransform(int picture, AffineTransform transform); 76 77 public void setPictureRepeat(int picture, int repeat); 78 79 public void setFilter(int picture, int filter); 80 81 public void renderRectangle(int dst, byte op, XRColor color, 82 int x, int y, int width, int height); 83 84 public void renderRectangles(int dst, byte op, XRColor color, 85 GrowableRectArray rects); 86 87 public void renderComposite(byte op, int src, int mask, int dst, 88 int srcX, int srcY, int maskX, int maskY, 89 int dstX, int dstY, int width, int height); 90 91 public int XRenderCreateGlyphSet(int formatID); 92 93 public void XRenderAddGlyphs(int glyphSet, GlyphList gl, 94 List<XRGlyphCacheEntry> cacheEntries, 95 byte[] pixelData); 96 97 public void XRenderFreeGlyphs(int glyphSet, int[] gids); 98 99 public void XRenderCompositeText(byte op, int src, int dst, 100 int maskFormatID, 101 int xSrc, int ySrc, int xDst, int yDst, 102 int glyphset, GrowableEltArray elts); 103 104 public int createRadialGradient(float centerX, float centerY, 105 float innerRadius, float outerRadius, 106 float[] fractions, int[] pixels, 107 int repeat); 108 109 public int createLinearGradient(Point2D p1, Point2D p2, float[] fractions, 110 int[] pixels, int repeat); 111 112 public void setGCMode(long gc, boolean copy); 113 114 }