use RrPlanarHasAlpha to determine if parent should be copied
authorDana Jansens <danakj@orodu.net>
Tue, 3 Jun 2003 20:28:22 +0000 (20:28 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 3 Jun 2003 20:28:22 +0000 (20:28 +0000)
render2/planar.c

index ba6ef899d295939bdfbbe8efbc58c509d93b8603..2f9ce6707a17e88ee9c4806821a30fcf5064d0b0 100644 (file)
@@ -29,53 +29,17 @@ void RrPlanarSet(struct RrSurface *sur,
 
 int RrPlanarHasAlpha(struct RrSurface *sur)
 {
-    if (RrColorHasAlpha(RrPlanarPrimaryColor(sur))) return 1;
-    if (!(RrPlanarColorType(sur) == RR_PLANAR_NONE ||
-          RrPlanarColorType(sur) == RR_PLANAR_SOLID))
-        if (RrColorHasAlpha(RrPlanarSecondaryColor(sur))) return 1;
+    if (!(RrPlanarColorType(sur) == RR_PLANAR_NONE)) {
+        if (RrColorHasAlpha(RrPlanarPrimaryColor(sur))) return 1;
+        if (!RrPlanarColorType(sur) == RR_PLANAR_SOLID)
+            if (RrColorHasAlpha(RrPlanarSecondaryColor(sur))) return 1;
+    }
     return 0;
 }
 
 static void copy_parent(struct RrSurface *sur)
 {
-    int ncols;
-    int copy;
-
-    switch (RrPlanarColorType(sur)) {
-    case RR_PLANAR_NONE:
-        return;
-    case RR_PLANAR_SOLID:
-        ncols = 1;
-        break;
-    case RR_PLANAR_HORIZONTAL:
-        ncols = 2;
-        break;
-    case RR_PLANAR_VERTICAL:
-        ncols = 2;
-        break;
-    case RR_PLANAR_DIAGONAL:
-        ncols = 2;
-        break;
-    case RR_PLANAR_CROSSDIAGONAL:
-        ncols = 2;
-        break;
-    case RR_PLANAR_PYRAMID:
-        ncols = 2;
-        break;
-    case RR_PLANAR_PIPECROSS:
-        ncols = 2;
-        break;
-    case RR_PLANAR_RECTANGLE:
-        ncols = 2;
-        break;
-    }
-
-    copy = 0;
-    if (ncols >= 1 && RrColorHasAlpha(RrPlanarPrimaryColor(sur)))
-        copy = 1;
-    if (ncols >= 1 && RrColorHasAlpha(RrPlanarSecondaryColor(sur)))
-        copy = 1;
-    if (copy) {
+    if (RrPlanarHasAlpha(sur)) {
         /*
         struct RrSurface *parent = RrSurfaceParent(sur);