sun.java2d.InvalidPipeException Java Examples
The following examples show how to use
sun.java2d.InvalidPipeException.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OGLRenderer.java From Bytecoder with Apache License 2.0 | 6 votes |
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 ? OGLContext.SRC_IS_OPAQUE : OGLContext.NO_CONTEXT_FLAGS; OGLSurfaceData dstData; try { dstData = (OGLSurfaceData)sg2d.surfaceData; } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } OGLContext.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(); } }
Example #2
Source File: OGLRenderer.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
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 ? OGLContext.SRC_IS_OPAQUE : OGLContext.NO_CONTEXT_FLAGS; OGLSurfaceData dstData; try { dstData = (OGLSurfaceData)sg2d.surfaceData; } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } OGLContext.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(); } }
Example #3
Source File: D3DRenderer.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
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(); } }
Example #4
Source File: GDIRenderer.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public void doFillSpans(SunGraphics2D sg2d, SpanIterator si) { int box[] = new int[4]; GDIWindowSurfaceData sd; try { sd = (GDIWindowSurfaceData)sg2d.surfaceData; } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } Region clip = sg2d.getCompClip(); Composite comp = sg2d.composite; int eargb = sg2d.eargb; while (si.nextSpan(box)) { doFillRect(sd, clip, comp, eargb, box[0], box[1], box[2]-box[0], box[3]-box[1]); } }
Example #5
Source File: WComponentPeer.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public void replaceSurfaceDataLater() { Runnable r = new Runnable() { @Override public void run() { // Shouldn't do anything if object is disposed in meanwhile // No need for sync as disposeAction in Window is performed // on EDT if (!isDisposed()) { try { replaceSurfaceData(); } catch (InvalidPipeException e) { // REMIND : what do we do if our surface creation failed? } } } }; Component c = (Component)target; // Fix 6255371. if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing(c, r)) { postEvent(new InvocationEvent(c, r)); } }
Example #6
Source File: WComponentPeer.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
@Override public void setBounds(int x, int y, int width, int height, int op) { // Should set paintPending before reahape to prevent // thread race between paint events // Native components do redraw after resize paintPending = (width != oldWidth) || (height != oldHeight); if ( (op & NO_EMBEDDED_CHECK) != 0 ) { reshapeNoCheck(x, y, width, height); } else { reshape(x, y, width, height); } if ((width != oldWidth) || (height != oldHeight)) { // Only recreate surfaceData if this setBounds is called // for a resize; a simple move should not trigger a recreation try { replaceSurfaceData(); } catch (InvalidPipeException e) { // REMIND : what do we do if our surface creation failed? } oldWidth = width; oldHeight = height; } serialNum++; }
Example #7
Source File: WComponentPeer.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
@Override public void setBounds(int x, int y, int width, int height, int op) { // Should set paintPending before reahape to prevent // thread race between paint events // Native components do redraw after resize paintPending = (width != oldWidth) || (height != oldHeight); if ( (op & NO_EMBEDDED_CHECK) != 0 ) { reshapeNoCheck(x, y, width, height); } else { reshape(x, y, width, height); } if ((width != oldWidth) || (height != oldHeight)) { // Only recreate surfaceData if this setBounds is called // for a resize; a simple move should not trigger a recreation try { replaceSurfaceData(); } catch (InvalidPipeException e) { // REMIND : what do we do if our surface creation failed? } oldWidth = width; oldHeight = height; } serialNum++; }
Example #8
Source File: D3DRenderer.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
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(); } }
Example #9
Source File: WComponentPeer.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@Override public void setBounds(int x, int y, int width, int height, int op) { // Should set paintPending before reahape to prevent // thread race between paint events // Native components do redraw after resize paintPending = (width != oldWidth) || (height != oldHeight); if ( (op & NO_EMBEDDED_CHECK) != 0 ) { reshapeNoCheck(x, y, width, height); } else { reshape(x, y, width, height); } if ((width != oldWidth) || (height != oldHeight)) { // Only recreate surfaceData if this setBounds is called // for a resize; a simple move should not trigger a recreation try { replaceSurfaceData(); } catch (InvalidPipeException e) { // REMIND : what do we do if our surface creation failed? } oldWidth = width; oldHeight = height; } serialNum++; }
Example #10
Source File: D3DRenderer.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
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(); } }
Example #11
Source File: OGLMaskFill.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
@Override protected void validateContext(SunGraphics2D sg2d, Composite comp, int ctxflags) { OGLSurfaceData dstData; try { dstData = (OGLSurfaceData) sg2d.surfaceData; } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } OGLContext.validateContext(dstData, dstData, sg2d.getCompClip(), comp, null, sg2d.paint, sg2d, ctxflags); }
Example #12
Source File: GDIRenderer.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
void doShape(SunGraphics2D sg2d, Shape s, boolean isfill) { Path2D.Float p2df; int transX; int transY; if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) { if (s instanceof Path2D.Float) { p2df = (Path2D.Float)s; } else { p2df = new Path2D.Float(s); } transX = sg2d.transX; transY = sg2d.transY; } else { p2df = new Path2D.Float(s, sg2d.transform); transX = 0; transY = 0; } try { doShape((GDIWindowSurfaceData)sg2d.surfaceData, sg2d.getCompClip(), sg2d.composite, sg2d.eargb, transX, transY, p2df, isfill); } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } }
Example #13
Source File: D3DSurfaceData.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
/** * Initializes the appropriate D3D offscreen surface based on the value * of the type parameter. If the surface creation fails for any reason, * an OutOfMemoryError will be thrown. */ protected void initSurface() { // any time we create or restore the surface, recreate the raster synchronized (this) { wrn = null; } // REMIND: somewhere a puppy died class Status { boolean success = false; }; final Status status = new Status(); D3DRenderQueue rq = D3DRenderQueue.getInstance(); rq.lock(); try { rq.flushAndInvokeNow(new Runnable() { public void run() { status.success = initSurfaceNow(); } }); if (!status.success) { throw new InvalidPipeException("Error creating D3DSurface"); } } finally { rq.unlock(); } }
Example #14
Source File: WComponentPeer.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public void replaceSurfaceDataLater() { Runnable r = new Runnable() { public void run() { // Shouldn't do anything if object is disposed in meanwhile // No need for sync as disposeAction in Window is performed // on EDT if (!isDisposed()) { try { replaceSurfaceData(); } catch (InvalidPipeException e) { // REMIND : what do we do if our surface creation failed? } } } }; Component c = (Component)target; // Fix 6255371. if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing(c, r)) { postEvent(new InvocationEvent(c, r)); } }
Example #15
Source File: OGLMaskFill.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
@Override protected void validateContext(SunGraphics2D sg2d, Composite comp, int ctxflags) { OGLSurfaceData dstData; try { dstData = (OGLSurfaceData) sg2d.surfaceData; } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } OGLContext.validateContext(dstData, dstData, sg2d.getCompClip(), comp, null, sg2d.paint, sg2d, ctxflags); }
Example #16
Source File: GDIRenderer.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
void doShape(SunGraphics2D sg2d, Shape s, boolean isfill) { Path2D.Float p2df; int transX; int transY; if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) { if (s instanceof Path2D.Float) { p2df = (Path2D.Float)s; } else { p2df = new Path2D.Float(s); } transX = sg2d.transX; transY = sg2d.transY; } else { p2df = new Path2D.Float(s, sg2d.transform); transX = 0; transY = 0; } try { doShape((GDIWindowSurfaceData)sg2d.surfaceData, sg2d.getCompClip(), sg2d.composite, sg2d.eargb, transX, transY, p2df, isfill); } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } }
Example #17
Source File: OGLMaskFill.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
@Override protected void validateContext(SunGraphics2D sg2d, Composite comp, int ctxflags) { OGLSurfaceData dstData; try { dstData = (OGLSurfaceData) sg2d.surfaceData; } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } OGLContext.validateContext(dstData, dstData, sg2d.getCompClip(), comp, null, sg2d.paint, sg2d, ctxflags); }
Example #18
Source File: WComponentPeer.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public void replaceSurfaceDataLater() { Runnable r = new Runnable() { @Override public void run() { // Shouldn't do anything if object is disposed in meanwhile // No need for sync as disposeAction in Window is performed // on EDT if (!isDisposed()) { try { replaceSurfaceData(); } catch (InvalidPipeException e) { // REMIND : what do we do if our surface creation failed? } } } }; Component c = (Component)target; // Fix 6255371. if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing(c, r)) { postEvent(new InvocationEvent(c, r)); } }
Example #19
Source File: D3DRenderer.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@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); }
Example #20
Source File: GDIRenderer.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
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); } }
Example #21
Source File: OGLRenderer.java From Bytecoder with Apache License 2.0 | 5 votes |
@Override protected void validateContext(SunGraphics2D sg2d) { int ctxflags = sg2d.paint.getTransparency() == Transparency.OPAQUE ? OGLContext.SRC_IS_OPAQUE : OGLContext.NO_CONTEXT_FLAGS; OGLSurfaceData dstData; try { dstData = (OGLSurfaceData)sg2d.surfaceData; } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } OGLContext.validateContext(dstData, dstData, sg2d.getCompClip(), sg2d.composite, null, sg2d.paint, sg2d, ctxflags); }
Example #22
Source File: GDIRenderer.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public void drawPolygon(SunGraphics2D sg2d, int xpoints[], int ypoints[], int npoints) { try { doDrawPoly((GDIWindowSurfaceData)sg2d.surfaceData, sg2d.getCompClip(), sg2d.composite, sg2d.eargb, sg2d.transX, sg2d.transY, xpoints, ypoints, npoints, true); } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } }
Example #23
Source File: WComponentPeer.java From hottub with GNU General Public License v2.0 | 5 votes |
void dynamicallyLayoutContainer() { // If we got the WM_SIZING, this must be a Container, right? // In fact, it must be the top-level Container. if (log.isLoggable(PlatformLogger.Level.FINE)) { Container parent = WToolkit.getNativeContainer((Component)target); if (parent != null) { log.fine("Assertion (parent == null) failed"); } } final Container cont = (Container)target; WToolkit.executeOnEventHandlerThread(cont, new Runnable() { @Override public void run() { // Discarding old paint events doesn't seem to be necessary. cont.invalidate(); cont.validate(); if (surfaceData instanceof D3DSurfaceData.D3DWindowSurfaceData || surfaceData instanceof OGLSurfaceData) { // When OGL or D3D is enabled, it is necessary to // replace the SurfaceData for each dynamic layout // request so that the viewport stays in sync // with the window bounds. try { replaceSurfaceData(); } catch (InvalidPipeException e) { // REMIND: this is unlikely to occur for OGL, but // what do we do if surface creation fails? } } // Forcing a paint here doesn't seem to be necessary. // paintDamagedAreaImmediately(); } }); }
Example #24
Source File: GDIRenderer.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public void drawRect(SunGraphics2D sg2d, int x, int y, int width, int height) { try { doDrawRect((GDIWindowSurfaceData)sg2d.surfaceData, sg2d.getCompClip(), sg2d.composite, sg2d.eargb, x+sg2d.transX, y+sg2d.transY, width, height); } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } }
Example #25
Source File: XRRenderer.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * 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); }
Example #26
Source File: D3DRenderer.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Override protected void validateContextAA(SunGraphics2D sg2d) { int ctxflags = 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); }
Example #27
Source File: GDIRenderer.java From hottub with GNU General Public License v2.0 | 5 votes |
public void fillRoundRect(SunGraphics2D sg2d, int x, int y, int width, int height, int arcWidth, int arcHeight) { try { doFillRoundRect((GDIWindowSurfaceData)sg2d.surfaceData, sg2d.getCompClip(), sg2d.composite, sg2d.eargb, x+sg2d.transX, y+sg2d.transY, width, height, arcWidth, arcHeight); } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } }
Example #28
Source File: OGLRenderer.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
@Override protected void validateContext(SunGraphics2D sg2d) { int ctxflags = sg2d.paint.getTransparency() == Transparency.OPAQUE ? OGLContext.SRC_IS_OPAQUE : OGLContext.NO_CONTEXT_FLAGS; OGLSurfaceData dstData; try { dstData = (OGLSurfaceData)sg2d.surfaceData; } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } OGLContext.validateContext(dstData, dstData, sg2d.getCompClip(), sg2d.composite, null, sg2d.paint, sg2d, ctxflags); }
Example #29
Source File: GDIRenderer.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height) { try { doFillRect((GDIWindowSurfaceData)sg2d.surfaceData, sg2d.getCompClip(), sg2d.composite, sg2d.eargb, x+sg2d.transX, y+sg2d.transY, width, height); } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } }
Example #30
Source File: GDIRenderer.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void drawArc(SunGraphics2D sg2d, int x, int y, int width, int height, int startAngle, int arcAngle) { try { doDrawArc((GDIWindowSurfaceData)sg2d.surfaceData, sg2d.getCompClip(), sg2d.composite, sg2d.eargb, x+sg2d.transX, y+sg2d.transY, width, height, startAngle, arcAngle); } catch (ClassCastException e) { throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); } }