Java 类sun.java2d.pipe.BufferedContext 实例源码

项目:jdk8u-jdk    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:openjdk9    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:jdk8u_jdk    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:infobip-open-jdk-8    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:jdk8u-dev-jdk    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:jdk7-jdk    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:openjdk-source-code-learn    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:OLD-OpenJDK8    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:JAVA_UNIT    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:openjdk-jdk7u-jdk    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:openjdk-icedtea7    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();
    final AccelDeviceEventListener l = new AccelDeviceEventListener() {
        public void onDeviceDispose() {
            System.out.println("onDeviceDispose invoked");
            agc.removeDeviceEventListener(this);
        }
        public void onDeviceReset() {
            System.out.println("onDeviceReset invoked");
        }
    };
    agc.addDeviceEventListener(l);

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:OpenJSharp    文件:TranslucentWindowPainter.java   
@Override
protected boolean update(Image bb) {
    if (bb instanceof DestSurfaceProvider) {
        Surface s = ((DestSurfaceProvider)bb).getDestSurface();
        if (s instanceof AccelSurface) {
            final int w = bb.getWidth(null);
            final int h = bb.getHeight(null);
            final boolean arr[] = { false };
            final AccelSurface as = (AccelSurface)s;
            RenderQueue rq = as.getContext().getRenderQueue();
            rq.lock();
            try {
                BufferedContext.validateContext(as);
                rq.flushAndInvokeNow(new Runnable() {
                    @Override
                    public void run() {
                        long psdops = as.getNativeOps();
                        arr[0] = updateWindowAccel(psdops, w, h);
                    }
                });
            } catch (InvalidPipeException e) {
                // ignore, false will be returned
            } finally {
                rq.unlock();
            }
            return arr[0];
        }
    }
    return super.update(bb);
}
项目:jdk8u-jdk    文件:TranslucentWindowPainter.java   
@Override
protected boolean update(Image bb) {
    if (bb instanceof DestSurfaceProvider) {
        Surface s = ((DestSurfaceProvider)bb).getDestSurface();
        if (s instanceof AccelSurface) {
            final int w = bb.getWidth(null);
            final int h = bb.getHeight(null);
            final boolean arr[] = { false };
            final AccelSurface as = (AccelSurface)s;
            RenderQueue rq = as.getContext().getRenderQueue();
            rq.lock();
            try {
                BufferedContext.validateContext(as);
                rq.flushAndInvokeNow(new Runnable() {
                    @Override
                    public void run() {
                        long psdops = as.getNativeOps();
                        arr[0] = updateWindowAccel(psdops, w, h);
                    }
                });
            } catch (InvalidPipeException e) {
                // ignore, false will be returned
            } finally {
                rq.unlock();
            }
            return arr[0];
        }
    }
    return super.update(bb);
}
项目:openjdk-jdk10    文件:TranslucentWindowPainter.java   
@Override
protected boolean update(Image bb) {
    if (bb instanceof DestSurfaceProvider) {
        Surface s = ((DestSurfaceProvider)bb).getDestSurface();
        if (s instanceof AccelSurface) {
            final boolean arr[] = { false };
            final AccelSurface as = (AccelSurface)s;
            final int w = as.getBounds().width;
            final int h = as.getBounds().height;
            RenderQueue rq = as.getContext().getRenderQueue();
            rq.lock();
            try {
                BufferedContext.validateContext(as);
                rq.flushAndInvokeNow(new Runnable() {
                    @Override
                    public void run() {
                        long psdops = as.getNativeOps();
                        arr[0] = updateWindowAccel(psdops, w, h);
                    }
                });
            } catch (InvalidPipeException e) {
                // ignore, false will be returned
            } finally {
                rq.unlock();
            }
            return arr[0];
        }
    }
    return super.update(bb);
}
项目:openjdk-jdk10    文件:RSLAPITest.java   
private static void testContext(final AccelGraphicsConfig agc) {
    BufferedContext c = agc.getContext();

    RenderQueue rq = c.getRenderQueue();
    rq.lock();
    try {
        c.saveState();
        rq.flushNow();
        c.restoreState();
        rq.flushNow();
        System.out.println("Passed: Save/Restore");
    } finally {
        rq.unlock();
    }
}
项目:openjdk9    文件:TranslucentWindowPainter.java   
@Override
protected boolean update(Image bb) {
    if (bb instanceof DestSurfaceProvider) {
        Surface s = ((DestSurfaceProvider)bb).getDestSurface();
        if (s instanceof AccelSurface) {
            final int w = bb.getWidth(null);
            final int h = bb.getHeight(null);
            final boolean arr[] = { false };
            final AccelSurface as = (AccelSurface)s;
            RenderQueue rq = as.getContext().getRenderQueue();
            rq.lock();
            try {
                BufferedContext.validateContext(as);
                rq.flushAndInvokeNow(new Runnable() {
                    @Override
                    public void run() {
                        long psdops = as.getNativeOps();
                        arr[0] = updateWindowAccel(psdops, w, h);
                    }
                });
            } catch (InvalidPipeException e) {
                // ignore, false will be returned
            } finally {
                rq.unlock();
            }
            return arr[0];
        }
    }
    return super.update(bb);
}
项目:jdk8u_jdk    文件:TranslucentWindowPainter.java   
@Override
protected boolean update(Image bb) {
    if (bb instanceof DestSurfaceProvider) {
        Surface s = ((DestSurfaceProvider)bb).getDestSurface();
        if (s instanceof AccelSurface) {
            final int w = bb.getWidth(null);
            final int h = bb.getHeight(null);
            final boolean arr[] = { false };
            final AccelSurface as = (AccelSurface)s;
            RenderQueue rq = as.getContext().getRenderQueue();
            rq.lock();
            try {
                BufferedContext.validateContext(as);
                rq.flushAndInvokeNow(new Runnable() {
                    @Override
                    public void run() {
                        long psdops = as.getNativeOps();
                        arr[0] = updateWindowAccel(psdops, w, h);
                    }
                });
            } catch (InvalidPipeException e) {
                // ignore, false will be returned
            } finally {
                rq.unlock();
            }
            return arr[0];
        }
    }
    return super.update(bb);
}
项目:lookaside_java-1.8.0-openjdk    文件:TranslucentWindowPainter.java   
@Override
protected boolean update(Image bb) {
    if (bb instanceof DestSurfaceProvider) {
        Surface s = ((DestSurfaceProvider)bb).getDestSurface();
        if (s instanceof AccelSurface) {
            final int w = bb.getWidth(null);
            final int h = bb.getHeight(null);
            final boolean arr[] = { false };
            final AccelSurface as = (AccelSurface)s;
            RenderQueue rq = as.getContext().getRenderQueue();
            rq.lock();
            try {
                BufferedContext.validateContext(as);
                rq.flushAndInvokeNow(new Runnable() {
                    @Override
                    public void run() {
                        long psdops = as.getNativeOps();
                        arr[0] = updateWindowAccel(psdops, w, h);
                    }
                });
            } catch (InvalidPipeException e) {
                // ignore, false will be returned
            } finally {
                rq.unlock();
            }
            return arr[0];
        }
    }
    return super.update(bb);
}
项目:infobip-open-jdk-8    文件:TranslucentWindowPainter.java   
@Override
protected boolean update(Image bb) {
    if (bb instanceof DestSurfaceProvider) {
        Surface s = ((DestSurfaceProvider)bb).getDestSurface();
        if (s instanceof AccelSurface) {
            final int w = bb.getWidth(null);
            final int h = bb.getHeight(null);
            final boolean arr[] = { false };
            final AccelSurface as = (AccelSurface)s;
            RenderQueue rq = as.getContext().getRenderQueue();
            rq.lock();
            try {
                BufferedContext.validateContext(as);
                rq.flushAndInvokeNow(new Runnable() {
                    @Override
                    public void run() {
                        long psdops = as.getNativeOps();
                        arr[0] = updateWindowAccel(psdops, w, h);
                    }
                });
            } catch (InvalidPipeException e) {
                // ignore, false will be returned
            } finally {
                rq.unlock();
            }
            return arr[0];
        }
    }
    return super.update(bb);
}
项目:jdk8u-dev-jdk    文件:TranslucentWindowPainter.java   
@Override
protected boolean update(Image bb) {
    if (bb instanceof DestSurfaceProvider) {
        Surface s = ((DestSurfaceProvider)bb).getDestSurface();
        if (s instanceof AccelSurface) {
            final int w = bb.getWidth(null);
            final int h = bb.getHeight(null);
            final boolean arr[] = { false };
            final AccelSurface as = (AccelSurface)s;
            RenderQueue rq = as.getContext().getRenderQueue();
            rq.lock();
            try {
                BufferedContext.validateContext(as);
                rq.flushAndInvokeNow(new Runnable() {
                    @Override
                    public void run() {
                        long psdops = as.getNativeOps();
                        arr[0] = updateWindowAccel(psdops, w, h);
                    }
                });
            } catch (InvalidPipeException e) {
                // ignore, false will be returned
            } finally {
                rq.unlock();
            }
            return arr[0];
        }
    }
    return super.update(bb);
}
项目:OLD-OpenJDK8    文件:TranslucentWindowPainter.java   
@Override
protected boolean update(Image bb) {
    if (bb instanceof DestSurfaceProvider) {
        Surface s = ((DestSurfaceProvider)bb).getDestSurface();
        if (s instanceof AccelSurface) {
            final int w = bb.getWidth(null);
            final int h = bb.getHeight(null);
            final boolean arr[] = { false };
            final AccelSurface as = (AccelSurface)s;
            RenderQueue rq = as.getContext().getRenderQueue();
            rq.lock();
            try {
                BufferedContext.validateContext(as);
                rq.flushAndInvokeNow(new Runnable() {
                    public void run() {
                        long psdops = as.getNativeOps();
                        arr[0] = updateWindowAccel(psdops, w, h);
                    }
                });
            } catch (InvalidPipeException e) {
                // ignore, false will be returned
            } finally {
                rq.unlock();
            }
            return arr[0];
        }
    }
    return super.update(bb);
}
项目:OpenJSharp    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!ge.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:jdk8u-jdk    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!ge.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:openjdk-jdk10    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!GraphicsEnvironment.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:openjdk9    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!GraphicsEnvironment.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:jdk8u_jdk    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!ge.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!ge.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:infobip-open-jdk-8    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!ge.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:jdk8u-dev-jdk    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!ge.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:jdk7-jdk    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!ge.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:openjdk-source-code-learn    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!ge.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:OLD-OpenJDK8    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!ge.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:openjdk-jdk7u-jdk    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!ge.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:openjdk-icedtea7    文件:StrikeCache.java   
static void disposeStrike(final FontStrikeDisposer disposer) {
    // we need to execute the strike disposal on the rendering thread
    // because they may be accessed on that thread at the time of the
    // disposal (for example, when the accel. cache is invalidated)

    // Whilst this is a bit heavyweight, in most applications
    // strike disposal is a relatively infrequent operation, so it
    // doesn't matter. But in some tests that use vast numbers
    // of strikes, the switching back and forth is measurable.
    // So the "pollRemove" call is added to batch up the work.
    // If we are polling we know we've already been called back
    // and can directly dispose the record.
    // Also worrisome is the necessity of getting a GC here.

    if (Disposer.pollingQueue) {
        doDispose(disposer);
        return;
    }

    RenderQueue rq = null;
    GraphicsEnvironment ge =
        GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!ge.isHeadless()) {
        GraphicsConfiguration gc =
            ge.getDefaultScreenDevice().getDefaultConfiguration();
        if (gc instanceof AccelGraphicsConfig) {
            AccelGraphicsConfig agc = (AccelGraphicsConfig)gc;
            BufferedContext bc = agc.getContext();
            if (bc != null) {
                rq = bc.getRenderQueue();
            }
        }
    }
    if (rq != null) {
        rq.lock();
        try {
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    doDispose(disposer);
                    Disposer.pollRemove();
                }
            });
        } finally {
            rq.unlock();
        }
    } else {
        doDispose(disposer);
    }
}
项目:OpenJSharp    文件:BufferedContextProvider.java   
/**
 * Retrieves a context associated with object implementing this
 * interface.
 *
 * @return associated context
 * @see sun.java2d.pipe.BufferedContext
 */
public BufferedContext getContext();
项目:jdk8u-jdk    文件:BufferedContextProvider.java   
/**
 * Retrieves a context associated with object implementing this
 * interface.
 *
 * @return associated context
 * @see sun.java2d.pipe.BufferedContext
 */
public BufferedContext getContext();
项目:openjdk-jdk10    文件:BufferedContextProvider.java   
/**
 * Retrieves a context associated with object implementing this
 * interface.
 *
 * @return associated context
 * @see sun.java2d.pipe.BufferedContext
 */
public BufferedContext getContext();
项目:openjdk9    文件:BufferedContextProvider.java   
/**
 * Retrieves a context associated with object implementing this
 * interface.
 *
 * @return associated context
 * @see sun.java2d.pipe.BufferedContext
 */
public BufferedContext getContext();
项目:jdk8u_jdk    文件:BufferedContextProvider.java   
/**
 * Retrieves a context associated with object implementing this
 * interface.
 *
 * @return associated context
 * @see sun.java2d.pipe.BufferedContext
 */
public BufferedContext getContext();