[libbluray-devel] Area: privatize data

hpi1 git at videolan.org
Sat Jun 10 13:43:22 CEST 2017


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat Jun 10 11:40:28 2017 +0300| [7d0e61043ed63cbbcd05ad445d07fa96f0be12ad] | committer: hpi1

Area: privatize data

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=7d0e61043ed63cbbcd05ad445d07fa96f0be12ad
---

 src/libbluray/bdj/java/java/awt/Area.java         | 21 +++++++++++++++++----
 src/libbluray/bdj/java/java/awt/BDRootWindow.java |  4 +++-
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/libbluray/bdj/java/java/awt/Area.java b/src/libbluray/bdj/java/java/awt/Area.java
index 90f48efa..0ddb88bc 100644
--- a/src/libbluray/bdj/java/java/awt/Area.java
+++ b/src/libbluray/bdj/java/java/awt/Area.java
@@ -20,10 +20,10 @@
 package java.awt;
 
 class Area {
-    public int x0;
-    public int y0;
-    public int x1;
-    public int y1;
+    private int x0;
+    private int y0;
+    private int x1;
+    private int y1;
 
     public Area() {
         this(Integer.MAX_VALUE, Integer.MAX_VALUE, -1, -1);
@@ -40,6 +40,19 @@ class Area {
         this.y1 = y1;
     }
 
+    public synchronized int getX0() {
+        return x0;
+    }
+    public synchronized int getY0() {
+        return y0;
+    }
+    public synchronized int getX1() {
+        return x1;
+    }
+    public synchronized int getY1() {
+        return y1;
+    }
+
     private void clear() {
         x0 = Integer.MAX_VALUE;
         y0 = Integer.MAX_VALUE;
diff --git a/src/libbluray/bdj/java/java/awt/BDRootWindow.java b/src/libbluray/bdj/java/java/awt/BDRootWindow.java
index 9fe6771b..91b86c7f 100644
--- a/src/libbluray/bdj/java/java/awt/BDRootWindow.java
+++ b/src/libbluray/bdj/java/java/awt/BDRootWindow.java
@@ -139,7 +139,9 @@ public class BDRootWindow extends Frame {
                     overlay_open = true;
                     a = new Area(getWidth(), getHeight()); /* force full plane update */
                 }
-                Libbluray.updateGraphic(getWidth(), getHeight(), backBuffer, a.x0, a.y0, a.x1, a.y1);
+
+                Libbluray.updateGraphic(getWidth(), getHeight(), backBuffer,
+                                        a.getX0(), a.getY0(), a.getX1(), a.getY1());
             }
         }
     }



More information about the libbluray-devel mailing list