Search in sources :

Example 16 with InvalidPipeException

use of sun.java2d.InvalidPipeException in project jdk8u_jdk by JetBrains.

the class XRRenderer method validateSurface.

/**
     * Common validate method, used by all XRRender functions to validate the
     * destination context.
     */
private final void validateSurface(SunGraphics2D sg2d) {
    XRSurfaceData xrsd;
    try {
        xrsd = (XRSurfaceData) sg2d.surfaceData;
    } catch (ClassCastException e) {
        throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData);
    }
    xrsd.validateAsDestination(sg2d, sg2d.getCompClip());
    xrsd.maskBuffer.validateCompositeState(sg2d.composite, sg2d.transform, sg2d.paint, sg2d);
}
Also used : InvalidPipeException(sun.java2d.InvalidPipeException)

Example 17 with InvalidPipeException

use of sun.java2d.InvalidPipeException in project jdk8u_jdk by JetBrains.

the class D3DRenderer method validateContext.

@Override
protected void validateContext(SunGraphics2D sg2d) {
    int ctxflags = sg2d.paint.getTransparency() == Transparency.OPAQUE ? D3DContext.SRC_IS_OPAQUE : D3DContext.NO_CONTEXT_FLAGS;
    D3DSurfaceData dstData;
    try {
        dstData = (D3DSurfaceData) sg2d.surfaceData;
    } catch (ClassCastException e) {
        throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData);
    }
    D3DContext.validateContext(dstData, dstData, sg2d.getCompClip(), sg2d.composite, null, sg2d.paint, sg2d, ctxflags);
}
Also used : InvalidPipeException(sun.java2d.InvalidPipeException)

Example 18 with InvalidPipeException

use of sun.java2d.InvalidPipeException in project jdk8u_jdk by JetBrains.

the class D3DRenderer method copyArea.

void copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, int dx, int dy) {
    rq.lock();
    try {
        int ctxflags = sg2d.surfaceData.getTransparency() == Transparency.OPAQUE ? D3DContext.SRC_IS_OPAQUE : D3DContext.NO_CONTEXT_FLAGS;
        D3DSurfaceData dstData;
        try {
            dstData = (D3DSurfaceData) sg2d.surfaceData;
        } catch (ClassCastException e) {
            throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData);
        }
        D3DContext.validateContext(dstData, dstData, sg2d.getCompClip(), sg2d.composite, null, null, null, ctxflags);
        rq.ensureCapacity(28);
        buf.putInt(COPY_AREA);
        buf.putInt(x).putInt(y).putInt(w).putInt(h);
        buf.putInt(dx).putInt(dy);
    } finally {
        rq.unlock();
    }
}
Also used : InvalidPipeException(sun.java2d.InvalidPipeException)

Example 19 with InvalidPipeException

use of sun.java2d.InvalidPipeException in project jdk8u_jdk by JetBrains.

the class D3DMaskFill method validateContext.

@Override
protected void validateContext(SunGraphics2D sg2d, Composite comp, int ctxflags) {
    D3DSurfaceData dstData;
    try {
        dstData = (D3DSurfaceData) sg2d.surfaceData;
    } catch (ClassCastException e) {
        throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData);
    }
    D3DContext.validateContext(dstData, dstData, sg2d.getCompClip(), comp, null, sg2d.paint, sg2d, ctxflags);
}
Also used : InvalidPipeException(sun.java2d.InvalidPipeException)

Example 20 with InvalidPipeException

use of sun.java2d.InvalidPipeException in project jdk8u_jdk by JetBrains.

the class GDIRenderer method drawLine.

public void drawLine(SunGraphics2D sg2d, int x1, int y1, int x2, int y2) {
    int transx = sg2d.transX;
    int transy = sg2d.transY;
    try {
        doDrawLine((GDIWindowSurfaceData) sg2d.surfaceData, sg2d.getCompClip(), sg2d.composite, sg2d.eargb, x1 + transx, y1 + transy, x2 + transx, y2 + transy);
    } catch (ClassCastException e) {
        throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData);
    }
}
Also used : InvalidPipeException(sun.java2d.InvalidPipeException)

Aggregations

InvalidPipeException (sun.java2d.InvalidPipeException)21 SurfaceData (sun.java2d.SurfaceData)3 Color (java.awt.Color)2 SurfaceType (sun.java2d.loops.SurfaceType)2 Component (java.awt.Component)1 Composite (java.awt.Composite)1 Paint (java.awt.Paint)1 InvocationEvent (java.awt.event.InvocationEvent)1 AffineTransform (java.awt.geom.AffineTransform)1 Path2D (java.awt.geom.Path2D)1 ColorModel (java.awt.image.ColorModel)1 Win32GraphicsConfig (sun.awt.Win32GraphicsConfig)1 WComponentPeer (sun.awt.windows.WComponentPeer)1 SunGraphics2D (sun.java2d.SunGraphics2D)1 Region (sun.java2d.pipe.Region)1 AccelSurface (sun.java2d.pipe.hw.AccelSurface)1 GDIWindowSurfaceData (sun.java2d.windows.GDIWindowSurfaceData)1