[libbluray-devel] Cosmetics
hpi1
git at videolan.org
Thu Apr 3 11:27:52 CEST 2014
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Apr 2 15:51:13 2014 +0300| [ed8bede3c0a0d8a699705a144bb17b0844f8d64b] | committer: hpi1
Cosmetics
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=ed8bede3c0a0d8a699705a144bb17b0844f8d64b
---
.../bdj/java/java/awt/BDGraphicsBase.java | 25 ++++++--------------
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java b/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
index 53d4d2f..1668064 100644
--- a/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
+++ b/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
@@ -976,6 +976,7 @@ abstract class BDGraphicsBase extends Graphics2D implements ConstrainableGraphic
int dx, int dy, int dw, int dh,
int sx, int sy, int sw, int sh,
Color bg, ImageObserver observer) {
+
if ((sx < 0) || (sy < 0) ||
(sw == 0) || (sh == 0) || (dw == 0) || (dh == 0))
return false;
@@ -1000,6 +1001,12 @@ abstract class BDGraphicsBase extends Graphics2D implements ConstrainableGraphic
}
}
+ int bgColor = 0;
+
+ if (bg != null) {
+ bgColor = bg.getRGB();
+ }
+
if(sx + sw > bdImage.width || sy + sh > bdImage.height) {
logger.info("drawImageN: fixing too small src image (src " + sx + "," + sy + " " + sw + "x" + sh + " ; img " + bdImage.width + "x" + bdImage.height + ")");
@@ -1009,19 +1016,6 @@ abstract class BDGraphicsBase extends Graphics2D implements ConstrainableGraphic
sx = 0;
sy = 0;
}
- /*
- if(sx + sw > bdImage.width) {
- int n = sx + sw - bdImage.width;
- dw -= dw * n / sw;
- sw -= n;
- }
-
- if(sy + sh > bdImage.height) {
- int n = sy + sh - bdImage.height;
- dh -= dh * n / sh;
- sh -= n;
- }
- */
if ((sw > 0) && (sh > 0) &&
((sx != 0) || (sy != 0) || (sw != bdImage.width) || (sh != bdImage.height))) {
@@ -1043,11 +1037,6 @@ abstract class BDGraphicsBase extends Graphics2D implements ConstrainableGraphic
bdImage = scaledImage;
}
int[] rgbArray = bdImage.getBdBackBuffer();
- int bgColor;
- if (bg != null)
- bgColor = bg.getRGB();
- else
- bgColor = 0;
for (int y = dy; y < (dy + bdImage.height); y++) {
More information about the libbluray-devel
mailing list