Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8254863: Delete code leftover from old fixes #691

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 5 additions & 24 deletions src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,6 @@ else if ((getColorSpaceType (p) == ColorSpace.TYPE_RGB) &&
*/
public static ICC_Profile getInstance (int cspace) {
ICC_Profile thisProfile = null;
String fileName;

switch (cspace) {
case ColorSpace.CS_sRGB:
synchronized(ICC_Profile.class) {
Expand Down Expand Up @@ -869,17 +867,11 @@ public static ICC_Profile getInstance (int cspace) {
case ColorSpace.CS_PYCC:
synchronized(ICC_Profile.class) {
if (PYCCprofile == null) {
if (standardProfileExists("PYCC.pf"))
{
ProfileDeferralInfo pInfo =
new ProfileDeferralInfo("PYCC.pf",
ColorSpace.TYPE_3CLR, 3,
CLASS_DISPLAY);
PYCCprofile = getDeferredInstance(pInfo);
} else {
throw new IllegalArgumentException(
"Can't load standard profile: PYCC.pf");
}
ProfileDeferralInfo pInfo =
new ProfileDeferralInfo("PYCC.pf",
ColorSpace.TYPE_3CLR, 3,
CLASS_DISPLAY);
PYCCprofile = getDeferredInstance(pInfo);
}
thisProfile = PYCCprofile;
}
Expand Down Expand Up @@ -1850,17 +1842,6 @@ private static boolean isChildOf(File f, String dirName) {
}
}

/**
* Checks whether built-in profile specified by fileName exists.
*/
private static boolean standardProfileExists(final String fileName) {
return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
public Boolean run() {
return PCMM.class.getResource("profiles/"+fileName) != null;
}
});
}

/*
* Serialization support.
*
Expand Down
14 changes: 3 additions & 11 deletions src/java.desktop/share/classes/sun/java2d/cmm/CMSManager.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,14 +25,11 @@

package sun.java2d.cmm;

import java.awt.color.CMMException;
import java.awt.color.ColorSpace;
import java.awt.color.ICC_Profile;
import java.awt.color.CMMException;
import java.awt.image.BufferedImage;
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
import java.security.AccessController;
import java.security.PrivilegedAction;

import sun.security.action.GetPropertyAction;

public class CMSManager {
Expand Down Expand Up @@ -103,11 +100,6 @@ public Profile loadProfile(byte[] data) {
return p;
}

public void freeProfile(Profile p) {
System.err.printf(cName + ".freeProfile(ID=%s)\n", p.toString());
tcmm.freeProfile(p);
}

public int getProfileSize(Profile p) {
System.err.print(cName + ".getProfileSize(ID=" + p + ")");
int size = tcmm.getProfileSize(p);
Expand Down
3 changes: 1 addition & 2 deletions src/java.desktop/share/classes/sun/java2d/cmm/PCMM.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -33,7 +33,6 @@ public interface PCMM {

/* methods invoked from ICC_Profile */
public Profile loadProfile(byte[] data);
public void freeProfile(Profile p);
public int getProfileSize(Profile p);
public void getProfileData(Profile p, byte[] data);
public void getTagData(Profile p, int tagSignature, byte[] data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -59,23 +59,6 @@ public static void registerDeferral(ProfileActivator pa) {
}


/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void unregisterDeferral(ProfileActivator pa) {

if (!deferring) {
return;
}
if (aVector == null) {
return;
}
aVector.removeElement(pa);
return;
}

/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
Expand Down
9 changes: 2 additions & 7 deletions src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMS.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -27,6 +27,7 @@

import java.awt.color.CMMException;
import java.awt.color.ICC_Profile;

import sun.java2d.cmm.ColorTransform;
import sun.java2d.cmm.PCMM;
import sun.java2d.cmm.Profile;
Expand Down Expand Up @@ -56,12 +57,6 @@ private LCMSProfile getLcmsProfile(Profile p) {
throw new CMMException("Invalid profile: " + p);
}


@Override
public void freeProfile(Profile p) {
// we use disposer, so this method does nothing
}

@Override
public int getProfileSize(final Profile p) {
synchronized (p) {
Expand Down