modules/javafx.graphics/src/main/native-prism-sw/PiscesPaint.c

Print this page

        

@@ -404,13 +404,11 @@
 }
 
 void
 genTexturePaintTarget(Renderer *rdr, jint *paint, jint height) {
     jint j;
-    jint minX, maxX;
     jint paintStride = rdr->_alphaWidth;
-    jint firstRowNum = rdr->_rowNum;
 
     jint x, y;
     jint* txtData = rdr->_texture_intData;
     jint txtWidth = rdr->_texture_imageWidth;
     jint txtHeight = rdr->_texture_imageHeight;

@@ -432,48 +430,22 @@
     } else {
         repeatInterpolateMode = (rdr->_texture_repeat) ?
             REPEAT_NO_INTERPOLATE : NO_REPEAT_NO_INTERPOLATE;
     }
 
-    minX = rdr->_minTouched;
-    maxX = rdr->_maxTouched;
-
     switch (rdr->_texture_transformType) {
     case TEXTURE_TRANSFORM_IDENTITY:
-        {
-        if (rdr->_texture_repeat) {
-            jint txtOffsetRepeat = rdr->_currX % txtWidth;
-            jint txtRowNumRepeat = rdr->_currY % txtHeight;
-            for (j = 0; j < height; j++) {
-                jint *tStart = txtData + txtStride * txtRowNumRepeat;
-                jint *t = tStart + txtOffsetRepeat;
-                jint *tEnd = tStart + txtWidth;
-                jint *d = paint + paintStride * j;
-                jint *dEnd = d + paintStride;
-                while (d < dEnd) {
-                    *d++ = *t++;
-                    if (t == tEnd) {
-                        t = tStart;
-                    }
-                }
-                txtRowNumRepeat++;
-                if (txtRowNumRepeat == txtHeight) {
-                    txtRowNumRepeat = 0;
-                }
-            }
-        } else {
-            jint minX = MAX(rdr->_rectX, rdr->_clip_bbMinX);
-            jint minY = MAX(rdr->_rectY, rdr->_clip_bbMinY);
-            jint clipOffset = (minY - rdr->_rectY) * txtStride + minX - rdr->_rectX;
-            for (j = 0; j < height; j++) {
-                memcpy(paint + paintStride * j,
-                     txtData + clipOffset + txtStride * (firstRowNum + j),
-                     sizeof(jint) * paintStride);
-            }
-        }
-        }
-        break;
+        // There used to be special case code for IDENTITY, but it had a number
+        // of bugs where it punted on some calculations which turned out to be
+        // necessary.  It was also rarely used because it relied on no
+        // translations to be set and/or no sub-textures to be used, which
+        // almost never happens in a scene graph, so this code was largely
+        // untested (witness the bugs mentioned above).  The decision was made
+        // to just have this case fall through to the translate case which is
+        // reasonably optimal and the code that was being used 99% of the
+        // time when there was no scale anyway.
+    /* NO BREAK */
 
     // just TRANSLATION
     case TEXTURE_TRANSFORM_TRANSLATE:
         {
         jint cval, pidx;