]> source.dussan.org Git - tigervnc.git/commitdiff
Remove unused alternative code path from the ZRLE and Hextile decoders
authorPierre Ossman <ossman@cendio.se>
Tue, 28 Jan 2014 15:41:29 +0000 (16:41 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 7 Jul 2014 11:27:07 +0000 (13:27 +0200)
common/rfb/hextileDecode.h
common/rfb/zrleDecode.h

index 77befc7d965441b899d7b7fb5eb0d89f5c70f54b..7aa04d9102c8b40449603b8ba16fc9a3b67d9c20 100644 (file)
@@ -69,13 +69,9 @@ void HEXTILE_DECODE (const Rect& r, rdr::InStream* is, PIXEL_T* buf
       if (tileType & hextileBgSpecified)
        bg = is->READ_PIXEL();
 
-#ifdef FAVOUR_FILL_RECT
-      FILL_RECT(t, bg);
-#else
       int len = t.area();
       PIXEL_T* ptr = (PIXEL_T*)buf;
       while (len-- > 0) *ptr++ = bg;
-#endif
 
       if (tileType & hextileFgSpecified)
        fg = is->READ_PIXEL();
@@ -91,14 +87,6 @@ void HEXTILE_DECODE (const Rect& r, rdr::InStream* is, PIXEL_T* buf
           int xy = is->readU8();
           int wh = is->readU8();
 
-#ifdef FAVOUR_FILL_RECT
-          Rect s;
-          s.tl.x = t.tl.x + ((xy >> 4) & 15);
-          s.tl.y = t.tl.y + (xy & 15);
-          s.br.x = s.tl.x + ((wh >> 4) & 15) + 1;
-          s.br.y = s.tl.y + (wh & 15) + 1;
-          FILL_RECT(s, fg);
-#else
           int x = ((xy >> 4) & 15);
           int y = (xy & 15);
           int w = ((wh >> 4) & 15) + 1;
@@ -110,12 +98,9 @@ void HEXTILE_DECODE (const Rect& r, rdr::InStream* is, PIXEL_T* buf
             while (len-- > 0) *ptr++ = fg;
             ptr += rowAdd;
           }
-#endif
         }
       }
-#ifndef FAVOUR_FILL_RECT
       IMAGE_RECT(t, buf);
-#endif
     }
   }
 }
index 8f6f7927e895c94afd98d712097f2e8d34a476bd..d26d4d3eae35df902e4e801c37346789f83925c9 100644 (file)
@@ -121,12 +121,6 @@ void ZRLE_DECODE (const Rect& r, rdr::InStream* is,
           }
         }
 
-#ifdef FAVOUR_FILL_RECT
-       //fprintf(stderr,"copying data to screen %dx%d at %d,%d\n",
-        //t.width(),t.height(),t.tl.x,t.tl.y);
-        IMAGE_RECT(t,buf);
-#endif
-
       } else {
 
         if (palSize == 0) {
@@ -149,36 +143,7 @@ void ZRLE_DECODE (const Rect& r, rdr::InStream* is,
               throw Exception ("ZRLE decode error");
             }
 
-#ifdef FAVOUR_FILL_RECT
-            int i = ptr - buf;
-            ptr += len;
-
-            int runX = i % t.width();
-            int runY = i / t.width();
-
-            if (runX + len > t.width()) {
-              if (runX != 0) {
-                FILL_RECT(Rect(t.tl.x+runX, t.tl.y+runY, t.width()-runX, 1),
-                          pix);
-                len -= t.width()-runX;
-                runX = 0;
-                runY++;
-              }
-
-              if (len > t.width()) {
-                FILL_RECT(Rect(t.tl.x, t.tl.y+runY, t.width(), len/t.width()),
-                          pix);
-                runY += len / t.width();
-                len = len % t.width();
-              }
-            }
-
-            if (len != 0) {
-              FILL_RECT(Rect(t.tl.x+runX, t.tl.y+runY, len, 1), pix);
-            }
-#else
             while (len-- > 0) *ptr++ = pix;
-#endif
 
           }
         } else {
@@ -207,45 +172,14 @@ void ZRLE_DECODE (const Rect& r, rdr::InStream* is,
 
             PIXEL_T pix = palette[index];
 
-#ifdef FAVOUR_FILL_RECT
-            int i = ptr - buf;
-            ptr += len;
-
-            int runX = i % t.width();
-            int runY = i / t.width();
-
-            if (runX + len > t.width()) {
-              if (runX != 0) {
-                FILL_RECT(Rect(t.tl.x+runX, t.tl.y+runY, t.width()-runX, 1),
-                          pix);
-                len -= t.width()-runX;
-                runX = 0;
-                runY++;
-              }
-
-              if (len > t.width()) {
-                FILL_RECT(Rect(t.tl.x, t.tl.y+runY, t.width(), len/t.width()),
-                          pix);
-                runY += len / t.width();
-                len = len % t.width();
-              }
-            }
-
-            if (len != 0) {
-              FILL_RECT(Rect(t.tl.x+runX, t.tl.y+runY, len, 1), pix);
-            }
-#else
             while (len-- > 0) *ptr++ = pix;
-#endif
           }
         }
       }
 
-#ifndef FAVOUR_FILL_RECT
       //fprintf(stderr,"copying data to screen %dx%d at %d,%d\n",
       //t.width(),t.height(),t.tl.x,t.tl.y);
       IMAGE_RECT(t,buf);
-#endif
     }
   }