[libbluray-devel] [Git][videolan/libbluray][master] 2 commits: HBackgroundImage: detach from sun.awt.image

Petri Hintukainen gitlab at videolan.org
Sun Apr 7 10:25:37 CEST 2019



Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
fa2f80fc by hpi1 at 2019-04-05T20:13:09Z
HBackgroundImage: detach from sun.awt.image

Use Toolkit instead.

- - - - -
ea51aa48 by hpi1 at 2019-04-05T20:14:56Z
Add logging

- - - - -


2 changed files:

- src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java
- src/libbluray/bdj/java/org/havi/ui/HBackgroundImage.java


Changes:

=====================================
src/libbluray/bdj/java/org/bluray/ti/selection/TitleContextImpl.java
=====================================
@@ -51,6 +51,8 @@ public class TitleContextImpl implements TitleContext {
     }
 
     public ServiceContentHandler[] getServiceContentHandlers() throws SecurityException {
+        logger.info("getServiceContentHandlers");
+
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
             sm.checkPermission(new ServiceContextPermission("getServiceContentHandlers", "own"));
@@ -129,6 +131,8 @@ public class TitleContextImpl implements TitleContext {
     }
 
     public void destroy() throws SecurityException {
+        logger.info("destroy()");
+
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
             sm.checkPermission(new ServiceContextPermission("stop", "own"));


=====================================
src/libbluray/bdj/java/org/havi/ui/HBackgroundImage.java
=====================================
@@ -29,14 +29,9 @@ import java.util.ArrayList;
 import org.havi.ui.event.HBackgroundImageEvent;
 import org.havi.ui.event.HBackgroundImageListener;
 
-import sun.awt.image.ByteArrayImageSource;
-import sun.awt.image.FileImageSource;
-import sun.awt.image.URLImageSource;
-
 public class HBackgroundImage implements ImageObserver {
     public HBackgroundImage(String filename) {
-        producer = new FileImageSource(filename);
-        img = Toolkit.getDefaultToolkit().createImage(producer);
+        img = Toolkit.getDefaultToolkit().createImage(filename);
     }
 
     public HBackgroundImage(byte pixels[]) {
@@ -44,13 +39,11 @@ public class HBackgroundImage implements ImageObserver {
             System.err.println("null pixels from " + org.videolan.Logger.dumpStack());
             return;
         }
-        producer = new ByteArrayImageSource(pixels);
-        img = Toolkit.getDefaultToolkit().createImage(producer);
+        img = Toolkit.getDefaultToolkit().createImage(pixels, 0, pixels.length);
     }
 
     public HBackgroundImage(URL contents) {
-        producer = new URLImageSource(contents);
-        img = Toolkit.getDefaultToolkit().createImage(producer);
+        img = Toolkit.getDefaultToolkit().createImage(contents);
     }
 
    public void load(HBackgroundImageListener listener) {



View it on GitLab: https://code.videolan.org/videolan/libbluray/compare/74193953124e2e6fb85888b5cc8695330c6f6a5f...ea51aa4841878de6cc32f1a044b5d44e5f067599

-- 
View it on GitLab: https://code.videolan.org/videolan/libbluray/compare/74193953124e2e6fb85888b5cc8695330c6f6a5f...ea51aa4841878de6cc32f1a044b5d44e5f067599
You're receiving this email because of your account on code.videolan.org.



More information about the libbluray-devel mailing list