Java 类sun.awt.image.MultiResolutionToolkitImage 实例源码

项目:jdk8u-jdk    文件:MultiResolutionDragImageTest.java   
private static Image createMultiResolutionImage() {

        return new MultiResolutionToolkitImage(
                createImage(50, COLOR_1X),
                createImage(100, COLOR_2X)
        );

    }
项目:openjdk-jdk10    文件:SunToolkit.java   
private int checkResolutionVariant(Image img, int w, int h, ImageObserver o) {
    ToolkitImage rvImage = getResolutionVariant(img);
    int rvw = getRVSize(w);
    int rvh = getRVSize(h);
    // Ignore the resolution variant in case of error
    return (rvImage == null || rvImage.hasError()) ? 0xFFFF :
            checkImage(rvImage, rvw, rvh, MultiResolutionToolkitImage.
                            getResolutionVariantObserver(
                                    img, o, w, h, rvw, rvh, true));
}
项目:openjdk-jdk10    文件:SunToolkit.java   
private boolean prepareResolutionVariant(Image img, int w, int h,
        ImageObserver o) {

    ToolkitImage rvImage = getResolutionVariant(img);
    int rvw = getRVSize(w);
    int rvh = getRVSize(h);
    // Ignore the resolution variant in case of error
    return rvImage == null || rvImage.hasError() || prepareImage(
            rvImage, rvw, rvh,
            MultiResolutionToolkitImage.getResolutionVariantObserver(
                    img, o, w, h, rvw, rvh, true));
}
项目:openjdk-jdk10    文件:SunToolkit.java   
private static ToolkitImage getResolutionVariant(Image image) {
    if (image instanceof MultiResolutionToolkitImage) {
        Image resolutionVariant = ((MultiResolutionToolkitImage) image).
                getResolutionVariant();
        if (resolutionVariant instanceof ToolkitImage) {
            return (ToolkitImage) resolutionVariant;
        }
    }
    return null;
}
项目:openjdk-jdk10    文件:MultiResolutionDragImageTest.java   
private static Image createMultiResolutionImage() {

        return new MultiResolutionToolkitImage(
                createImage(50, COLOR_1X),
                createImage(100, COLOR_2X)
        );

    }
项目:openjdk9    文件:SunToolkit.java   
private int checkResolutionVariant(Image img, int w, int h, ImageObserver o) {
    ToolkitImage rvImage = getResolutionVariant(img);
    int rvw = getRVSize(w);
    int rvh = getRVSize(h);
    // Ignore the resolution variant in case of error
    return (rvImage == null || rvImage.hasError()) ? 0xFFFF :
            checkImage(rvImage, rvw, rvh, MultiResolutionToolkitImage.
                            getResolutionVariantObserver(
                                    img, o, w, h, rvw, rvh, true));
}
项目:openjdk9    文件:SunToolkit.java   
private boolean prepareResolutionVariant(Image img, int w, int h,
        ImageObserver o) {

    ToolkitImage rvImage = getResolutionVariant(img);
    int rvw = getRVSize(w);
    int rvh = getRVSize(h);
    // Ignore the resolution variant in case of error
    return rvImage == null || rvImage.hasError() || prepareImage(
            rvImage, rvw, rvh,
            MultiResolutionToolkitImage.getResolutionVariantObserver(
                    img, o, w, h, rvw, rvh, true));
}
项目:openjdk9    文件:SunToolkit.java   
private static ToolkitImage getResolutionVariant(Image image) {
    if (image instanceof MultiResolutionToolkitImage) {
        Image resolutionVariant = ((MultiResolutionToolkitImage) image).
                getResolutionVariant();
        if (resolutionVariant instanceof ToolkitImage) {
            return (ToolkitImage) resolutionVariant;
        }
    }
    return null;
}
项目:openjdk9    文件:MultiResolutionDragImageTest.java   
private static Image createMultiResolutionImage() {

        return new MultiResolutionToolkitImage(
                createImage(50, COLOR_1X),
                createImage(100, COLOR_2X)
        );

    }
项目:jdk8u_jdk    文件:MultiResolutionDragImageTest.java   
private static Image createMultiResolutionImage() {

        return new MultiResolutionToolkitImage(
                createImage(50, COLOR_1X),
                createImage(100, COLOR_2X)
        );

    }
项目:lookaside_java-1.8.0-openjdk    文件:MultiResolutionDragImageTest.java   
private static Image createMultiResolutionImage() {

        return new MultiResolutionToolkitImage(
                createImage(50, COLOR_1X),
                createImage(100, COLOR_2X)
        );

    }
项目:OpenJSharp    文件:MediaTracker.java   
private static Image getResolutionVariant(Image image) {
    if (image instanceof MultiResolutionToolkitImage) {
        return ((MultiResolutionToolkitImage) image).getResolutionVariant();
    }
    return null;
}
项目:OpenJSharp    文件:SunGraphics2D.java   
private boolean drawHiDPIImage(Image img, int dx1, int dy1, int dx2,
                               int dy2, int sx1, int sy1, int sx2, int sy2,
                               Color bgcolor, ImageObserver observer) {

    if (SurfaceManager.getImageScale(img) != 1) {  // Volatile Image
        final int scale = SurfaceManager.getImageScale(img);
        sx1 = Region.clipScale(sx1, scale);
        sx2 = Region.clipScale(sx2, scale);
        sy1 = Region.clipScale(sy1, scale);
        sy2 = Region.clipScale(sy2, scale);
    } else if (img instanceof MultiResolutionImage) {
        // get scaled destination image size

        int width = img.getWidth(observer);
        int height = img.getHeight(observer);

        Image resolutionVariant = getResolutionVariant(
                (MultiResolutionImage) img, width, height,
                dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2);

        if (resolutionVariant != img && resolutionVariant != null) {
            // recalculate source region for the resolution variant

            ImageObserver rvObserver = MultiResolutionToolkitImage.
                    getResolutionVariantObserver(img, observer,
                            width, height, -1, -1);

            int rvWidth = resolutionVariant.getWidth(rvObserver);
            int rvHeight = resolutionVariant.getHeight(rvObserver);

            if (0 < width && 0 < height && 0 < rvWidth && 0 < rvHeight) {

                float widthScale = ((float) rvWidth) / width;
                float heightScale = ((float) rvHeight) / height;

                sx1 = Region.clipScale(sx1, widthScale);
                sy1 = Region.clipScale(sy1, heightScale);
                sx2 = Region.clipScale(sx2, widthScale);
                sy2 = Region.clipScale(sy2, heightScale);

                observer = rvObserver;
                img = resolutionVariant;
            }
        }
    }

    try {
        return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1, sy1,
                                    sx2, sy2, bgcolor, observer);
    } catch (InvalidPipeException e) {
        try {
            revalidateAll();
            return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1,
                                        sy1, sx2, sy2, bgcolor, observer);
        } catch (InvalidPipeException e2) {
            // Still catching the exception; we are not yet ready to
            // validate the surfaceData correctly.  Fail for now and
            // try again next time around.
            return false;
        }
    } finally {
        surfaceData.markDirty();
    }
}
项目:jdk8u-jdk    文件:MediaTracker.java   
private static Image getResolutionVariant(Image image) {
    if (image instanceof MultiResolutionToolkitImage) {
        return ((MultiResolutionToolkitImage) image).getResolutionVariant();
    }
    return null;
}
项目:jdk8u-jdk    文件:SunGraphics2D.java   
private boolean drawHiDPIImage(Image img, int dx1, int dy1, int dx2,
                               int dy2, int sx1, int sy1, int sx2, int sy2,
                               Color bgcolor, ImageObserver observer) {

    if (SurfaceManager.getImageScale(img) != 1) {  // Volatile Image
        final int scale = SurfaceManager.getImageScale(img);
        sx1 = Region.clipScale(sx1, scale);
        sx2 = Region.clipScale(sx2, scale);
        sy1 = Region.clipScale(sy1, scale);
        sy2 = Region.clipScale(sy2, scale);
    } else if (img instanceof MultiResolutionImage) {
        // get scaled destination image size

        int width = img.getWidth(observer);
        int height = img.getHeight(observer);

        Image resolutionVariant = getResolutionVariant(
                (MultiResolutionImage) img, width, height,
                dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2);

        if (resolutionVariant != img && resolutionVariant != null) {
            // recalculate source region for the resolution variant

            ImageObserver rvObserver = MultiResolutionToolkitImage.
                    getResolutionVariantObserver(img, observer,
                            width, height, -1, -1);

            int rvWidth = resolutionVariant.getWidth(rvObserver);
            int rvHeight = resolutionVariant.getHeight(rvObserver);

            if (0 < width && 0 < height && 0 < rvWidth && 0 < rvHeight) {

                float widthScale = ((float) rvWidth) / width;
                float heightScale = ((float) rvHeight) / height;

                sx1 = Region.clipScale(sx1, widthScale);
                sy1 = Region.clipScale(sy1, heightScale);
                sx2 = Region.clipScale(sx2, widthScale);
                sy2 = Region.clipScale(sy2, heightScale);

                observer = rvObserver;
                img = resolutionVariant;
            }
        }
    }

    try {
        return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1, sy1,
                                    sx2, sy2, bgcolor, observer);
    } catch (InvalidPipeException e) {
        try {
            revalidateAll();
            return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1,
                                        sy1, sx2, sy2, bgcolor, observer);
        } catch (InvalidPipeException e2) {
            // Still catching the exception; we are not yet ready to
            // validate the surfaceData correctly.  Fail for now and
            // try again next time around.
            return false;
        }
    } finally {
        surfaceData.markDirty();
    }
}
项目:jdk8u-jdk    文件:MultiResolutionToolkitImageTest.java   
static Image getResolutionVariant(Image image) {
    return ((MultiResolutionToolkitImage) image).getResolutionVariant();
}
项目:openjdk-jdk10    文件:MediaTracker.java   
private static Image getResolutionVariant(Image image) {
    if (image instanceof MultiResolutionToolkitImage) {
        return ((MultiResolutionToolkitImage) image).getResolutionVariant();
    }
    return null;
}
项目:openjdk-jdk10    文件:SunToolkit.java   
public static Image createImageWithResolutionVariant(Image image,
        Image resolutionVariant) {
    return new MultiResolutionToolkitImage(image, resolutionVariant);
}
项目:openjdk-jdk10    文件:MultiResolutionToolkitImageTest.java   
static Image getResolutionVariant(Image image) {
    return ((MultiResolutionToolkitImage) image).getResolutionVariant();
}
项目:openjdk9    文件:MediaTracker.java   
private static Image getResolutionVariant(Image image) {
    if (image instanceof MultiResolutionToolkitImage) {
        return ((MultiResolutionToolkitImage) image).getResolutionVariant();
    }
    return null;
}
项目:openjdk9    文件:SunToolkit.java   
public static Image createImageWithResolutionVariant(Image image,
        Image resolutionVariant) {
    return new MultiResolutionToolkitImage(image, resolutionVariant);
}
项目:openjdk9    文件:MultiResolutionToolkitImageTest.java   
static Image getResolutionVariant(Image image) {
    return ((MultiResolutionToolkitImage) image).getResolutionVariant();
}
项目:Java8CN    文件:MediaTracker.java   
private static Image getResolutionVariant(Image image) {
    if (image instanceof MultiResolutionToolkitImage) {
        return ((MultiResolutionToolkitImage) image).getResolutionVariant();
    }
    return null;
}
项目:jdk8u_jdk    文件:MediaTracker.java   
private static Image getResolutionVariant(Image image) {
    if (image instanceof MultiResolutionToolkitImage) {
        return ((MultiResolutionToolkitImage) image).getResolutionVariant();
    }
    return null;
}
项目:jdk8u_jdk    文件:MultiResolutionToolkitImageTest.java   
static Image getResolutionVariant(Image image) {
    return ((MultiResolutionToolkitImage) image).getResolutionVariant();
}
项目:lookaside_java-1.8.0-openjdk    文件:MediaTracker.java   
private static Image getResolutionVariant(Image image) {
    if (image instanceof MultiResolutionToolkitImage) {
        return ((MultiResolutionToolkitImage) image).getResolutionVariant();
    }
    return null;
}
项目:lookaside_java-1.8.0-openjdk    文件:SunGraphics2D.java   
private boolean drawHiDPIImage(Image img, int dx1, int dy1, int dx2,
                               int dy2, int sx1, int sy1, int sx2, int sy2,
                               Color bgcolor, ImageObserver observer) {

    if (SurfaceManager.getImageScale(img) != 1) {  // Volatile Image
        final int scale = SurfaceManager.getImageScale(img);
        sx1 = Region.clipScale(sx1, scale);
        sx2 = Region.clipScale(sx2, scale);
        sy1 = Region.clipScale(sy1, scale);
        sy2 = Region.clipScale(sy2, scale);
    } else if (img instanceof MultiResolutionImage) {
        // get scaled destination image size

        int width = img.getWidth(observer);
        int height = img.getHeight(observer);

        Image resolutionVariant = getResolutionVariant(
                (MultiResolutionImage) img, width, height,
                dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2);

        if (resolutionVariant != img && resolutionVariant != null) {
            // recalculate source region for the resolution variant

            ImageObserver rvObserver = MultiResolutionToolkitImage.
                    getResolutionVariantObserver(img, observer,
                            width, height, -1, -1);

            int rvWidth = resolutionVariant.getWidth(rvObserver);
            int rvHeight = resolutionVariant.getHeight(rvObserver);

            if (0 < width && 0 < height && 0 < rvWidth && 0 < rvHeight) {

                float widthScale = ((float) rvWidth) / width;
                float heightScale = ((float) rvHeight) / height;

                sx1 = Region.clipScale(sx1, widthScale);
                sy1 = Region.clipScale(sy1, heightScale);
                sx2 = Region.clipScale(sx2, widthScale);
                sy2 = Region.clipScale(sy2, heightScale);

                observer = rvObserver;
                img = resolutionVariant;
            }
        }
    }

    try {
        return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1, sy1,
                                    sx2, sy2, bgcolor, observer);
    } catch (InvalidPipeException e) {
        try {
            revalidateAll();
            return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1,
                                        sy1, sx2, sy2, bgcolor, observer);
        } catch (InvalidPipeException e2) {
            // Still catching the exception; we are not yet ready to
            // validate the surfaceData correctly.  Fail for now and
            // try again next time around.
            return false;
        }
    } finally {
        surfaceData.markDirty();
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:MultiResolutionToolkitImageTest.java   
static Image getResolutionVariant(Image image) {
    return ((MultiResolutionToolkitImage) image).getResolutionVariant();
}
项目:infobip-open-jdk-8    文件:MediaTracker.java   
private static Image getResolutionVariant(Image image) {
    if (image instanceof MultiResolutionToolkitImage) {
        return ((MultiResolutionToolkitImage) image).getResolutionVariant();
    }
    return null;
}
项目:infobip-open-jdk-8    文件:SunGraphics2D.java   
private boolean drawHiDPIImage(Image img, int dx1, int dy1, int dx2,
                               int dy2, int sx1, int sy1, int sx2, int sy2,
                               Color bgcolor, ImageObserver observer) {

    if (SurfaceManager.getImageScale(img) != 1) {  // Volatile Image
        final int scale = SurfaceManager.getImageScale(img);
        sx1 = Region.clipScale(sx1, scale);
        sx2 = Region.clipScale(sx2, scale);
        sy1 = Region.clipScale(sy1, scale);
        sy2 = Region.clipScale(sy2, scale);
    } else if (img instanceof MultiResolutionImage) {
        // get scaled destination image size

        int width = img.getWidth(observer);
        int height = img.getHeight(observer);

        Image resolutionVariant = getResolutionVariant(
                (MultiResolutionImage) img, width, height,
                dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2);

        if (resolutionVariant != img && resolutionVariant != null) {
            // recalculate source region for the resolution variant

            ImageObserver rvObserver = MultiResolutionToolkitImage.
                    getResolutionVariantObserver(img, observer,
                            width, height, -1, -1);

            int rvWidth = resolutionVariant.getWidth(rvObserver);
            int rvHeight = resolutionVariant.getHeight(rvObserver);

            if (0 < width && 0 < height && 0 < rvWidth && 0 < rvHeight) {

                float widthScale = ((float) rvWidth) / width;
                float heightScale = ((float) rvHeight) / height;

                sx1 = Region.clipScale(sx1, widthScale);
                sy1 = Region.clipScale(sy1, heightScale);
                sx2 = Region.clipScale(sx2, widthScale);
                sy2 = Region.clipScale(sy2, heightScale);

                observer = rvObserver;
                img = resolutionVariant;
            }
        }
    }

    try {
        return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1, sy1,
                                    sx2, sy2, bgcolor, observer);
    } catch (InvalidPipeException e) {
        try {
            revalidateAll();
            return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1,
                                        sy1, sx2, sy2, bgcolor, observer);
        } catch (InvalidPipeException e2) {
            // Still catching the exception; we are not yet ready to
            // validate the surfaceData correctly.  Fail for now and
            // try again next time around.
            return false;
        }
    } finally {
        surfaceData.markDirty();
    }
}
项目:infobip-open-jdk-8    文件:MultiResolutionToolkitImageTest.java   
static Image getResolutionVariant(Image image) {
    return ((MultiResolutionToolkitImage) image).getResolutionVariant();
}
项目:jdk8u-dev-jdk    文件:MediaTracker.java   
private static Image getResolutionVariant(Image image) {
    if (image instanceof MultiResolutionToolkitImage) {
        return ((MultiResolutionToolkitImage) image).getResolutionVariant();
    }
    return null;
}
项目:jdk8u-dev-jdk    文件:SunGraphics2D.java   
private boolean drawHiDPIImage(Image img, int dx1, int dy1, int dx2,
                               int dy2, int sx1, int sy1, int sx2, int sy2,
                               Color bgcolor, ImageObserver observer) {

    if (SurfaceManager.getImageScale(img) != 1) {  // Volatile Image
        final int scale = SurfaceManager.getImageScale(img);
        sx1 = Region.clipScale(sx1, scale);
        sx2 = Region.clipScale(sx2, scale);
        sy1 = Region.clipScale(sy1, scale);
        sy2 = Region.clipScale(sy2, scale);
    } else if (img instanceof MultiResolutionImage) {
        // get scaled destination image size

        int width = img.getWidth(observer);
        int height = img.getHeight(observer);

        Image resolutionVariant = getResolutionVariant(
                (MultiResolutionImage) img, width, height,
                dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2);

        if (resolutionVariant != img && resolutionVariant != null) {
            // recalculate source region for the resolution variant

            ImageObserver rvObserver = MultiResolutionToolkitImage.
                    getResolutionVariantObserver(img, observer,
                            width, height, -1, -1);

            int rvWidth = resolutionVariant.getWidth(rvObserver);
            int rvHeight = resolutionVariant.getHeight(rvObserver);

            if (0 < width && 0 < height && 0 < rvWidth && 0 < rvHeight) {

                float widthScale = ((float) rvWidth) / width;
                float heightScale = ((float) rvHeight) / height;

                sx1 = Region.clipScale(sx1, widthScale);
                sy1 = Region.clipScale(sy1, heightScale);
                sx2 = Region.clipScale(sx2, widthScale);
                sy2 = Region.clipScale(sy2, heightScale);

                observer = rvObserver;
                img = resolutionVariant;
            }
        }
    }

    try {
        return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1, sy1,
                                    sx2, sy2, bgcolor, observer);
    } catch (InvalidPipeException e) {
        try {
            revalidateAll();
            return imagepipe.scaleImage(this, img, dx1, dy1, dx2, dy2, sx1,
                                        sy1, sx2, sy2, bgcolor, observer);
        } catch (InvalidPipeException e2) {
            // Still catching the exception; we are not yet ready to
            // validate the surfaceData correctly.  Fail for now and
            // try again next time around.
            return false;
        }
    } finally {
        surfaceData.markDirty();
    }
}
项目:jdk8u-dev-jdk    文件:MultiResolutionToolkitImageTest.java   
static Image getResolutionVariant(Image image) {
    return ((MultiResolutionToolkitImage) image).getResolutionVariant();
}