@@ -175,6 +175,8 @@ void drawTex2Tex(MTLContext *mtlc,
175
175
const int dh = dy2 - dy1;
176
176
177
177
const void * raster = srcInfo->rasBase ;
178
+ raster += srcInfo->bounds .y1 *srcInfo->scanStride + srcInfo->bounds .x1 *srcInfo->pixelStride ;
179
+
178
180
id <MTLTexture > result = nil ;
179
181
if (rfi->permuteMap != NULL ) {
180
182
#if defined(__MAC_10_15) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_15
@@ -221,7 +223,7 @@ void drawTex2Tex(MTLContext *mtlc,
221
223
srcBuf.height = dh;
222
224
srcBuf.width = dw;
223
225
srcBuf.rowBytes = srcInfo->scanStride ;
224
- srcBuf.data = srcInfo-> rasBase ;
226
+ srcBuf.data = raster ;
225
227
226
228
vImage_Buffer destBuf;
227
229
destBuf.height = dh;
@@ -354,22 +356,22 @@ jboolean clipDestCoords(
354
356
return JNI_FALSE;
355
357
}
356
358
if (*dx1 < dcx1) {
357
- J2dTraceLn2 (J2D_TRACE_VERBOSE, " \t\t dx1=%1.2f , will be clipped to %1.2f " , *dx1, dcx1);
359
+ J2dTraceLn3 (J2D_TRACE_VERBOSE, " \t\t dx1=%1.2f , will be clipped to %1.2f | sx1+= %d " , *dx1, dcx1, (jint)((dcx1 - *dx1) * (sw/dw)) );
358
360
*sx1 += (jint)((dcx1 - *dx1) * (sw/dw));
359
361
*dx1 = dcx1;
360
362
}
361
363
if (*dx2 > dcx2) {
362
- J2dTraceLn2 (J2D_TRACE_VERBOSE, " \t\t dx2=%1.2f , will be clipped to %1.2f " , *dx2, dcx2);
364
+ J2dTraceLn3 (J2D_TRACE_VERBOSE, " \t\t dx2=%1.2f , will be clipped to %1.2f | sx2-= %d " , *dx2, dcx2, (jint)((*dx2 - dcx2) * (sw/dw)) );
363
365
*sx2 -= (jint)((*dx2 - dcx2) * (sw/dw));
364
366
*dx2 = dcx2;
365
367
}
366
368
if (*dy1 < dcy1) {
367
- J2dTraceLn2 (J2D_TRACE_VERBOSE, " \t\t dy1=%1.2f , will be clipped to %1.2f " , *dy1, dcy1);
369
+ J2dTraceLn3 (J2D_TRACE_VERBOSE, " \t\t dy1=%1.2f , will be clipped to %1.2f | sy1+= %d " , *dy1, dcy1, (jint)((dcy1 - *dy1) * (sh/dh)) );
368
370
*sy1 += (jint)((dcy1 - *dy1) * (sh/dh));
369
371
*dy1 = dcy1;
370
372
}
371
373
if (*dy2 > dcy2) {
372
- J2dTraceLn2 (J2D_TRACE_VERBOSE, " \t\t dy2=%1.2f , will be clipped to %1.2f " , *dy2, dcy2);
374
+ J2dTraceLn3 (J2D_TRACE_VERBOSE, " \t\t dy2=%1.2f , will be clipped to %1.2f | sy2-= %d " , *dy2, dcy2, (jint)((*dy2 - dcy2) * (sh/dh)) );
373
375
*sy2 -= (jint)((*dy2 - dcy2) * (sh/dh));
374
376
*dy2 = dcy2;
375
377
}
0 commit comments