[libbluray-devel] BDGraphics: simplify (composite is never null)
hpi1
git at videolan.org
Sun Mar 23 12:02:11 CET 2014
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Mar 19 21:17:52 2014 +0200| [ec7550008588f08fde7929b1ad8af1ac2a56cb3f] | committer: hpi1
BDGraphics: simplify (composite is never null)
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=ec7550008588f08fde7929b1ad8af1ac2a56cb3f
---
src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java | 18 ++----------------
src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java | 18 ++----------------
2 files changed, 4 insertions(+), 32 deletions(-)
diff --git a/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java b/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java
index 7b50208..6781ebf 100644
--- a/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java
+++ b/src/libbluray/bdj/java-j2me/java/awt/BDGraphics.java
@@ -305,14 +305,7 @@ class BDGraphics extends Graphics2D implements ConstrainableGraphics {
return;
}
- int rule;
- if (composite != null) {
- rule = composite.getRule();
- } else {
- rule = AlphaComposite.SRC_OVER;
- }
-
- switch (rule) {
+ switch (composite.getRule()) {
case AlphaComposite.CLEAR:
for (int i = 0; i < length; i++) {
backBuffer[y * width + x + i] = 0;
@@ -355,14 +348,7 @@ class BDGraphics extends Graphics2D implements ConstrainableGraphics {
return;
}
- int rule;
- if (composite != null) {
- rule = composite.getRule();
- } else {
- rule = AlphaComposite.SRC_OVER;
- }
-
- switch (rule) {
+ switch (composite.getRule()) {
case AlphaComposite.CLEAR:
for (int i = 0; i < length; i++) {
backBuffer[y * width + x + i] = 0;
diff --git a/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java b/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java
index f5931bf..714b67c 100644
--- a/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java
+++ b/src/libbluray/bdj/java-j2se/java/awt/BDGraphics.java
@@ -393,14 +393,7 @@ class BDGraphics extends Graphics2D implements ConstrainableGraphics {
return;
}
- int rule;
- if (composite != null) {
- rule = composite.getRule();
- } else {
- rule = AlphaComposite.SRC_OVER;
- }
-
- switch (rule) {
+ switch (composite.getRule()) {
case AlphaComposite.CLEAR:
for (int i = 0; i < length; i++) {
backBuffer[y * width + x + i] = 0;
@@ -443,14 +436,7 @@ class BDGraphics extends Graphics2D implements ConstrainableGraphics {
return;
}
- int rule;
- if (composite != null) {
- rule = composite.getRule();
- } else {
- rule = AlphaComposite.SRC_OVER;
- }
-
- switch (rule) {
+ switch (composite.getRule()) {
case AlphaComposite.CLEAR:
for (int i = 0; i < length; i++) {
backBuffer[y * width + x + i] = 0;
More information about the libbluray-devel
mailing list