Skip to content
Permalink
Browse files

8242952: fixed MTLBlitLoops::replaceTextureRegion (add correct offset…

Co-authored-by: Artem Bochkarev <abochkarev@openjdk.org>
Co-authored-by: add Artem Bochkarev <abochkarev@openjdk.org>
  • Loading branch information
Alexey Ushakov Artem Bochkarev
Alexey Ushakov and Artem Bochkarev committed Jun 2, 2020
1 parent a403550 commit c723f0966a9ec93a140478076a3b9059df4d6e41
@@ -175,6 +175,8 @@ void drawTex2Tex(MTLContext *mtlc,
const int dh = dy2 - dy1;

const void * raster = srcInfo->rasBase;
raster += srcInfo->bounds.y1*srcInfo->scanStride + srcInfo->bounds.x1*srcInfo->pixelStride;

id<MTLTexture> result = nil;
if (rfi->permuteMap != NULL) {
#if defined(__MAC_10_15) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_15
@@ -221,7 +223,7 @@ void drawTex2Tex(MTLContext *mtlc,
srcBuf.height = dh;
srcBuf.width = dw;
srcBuf.rowBytes = srcInfo->scanStride;
srcBuf.data = srcInfo->rasBase;
srcBuf.data = raster;

vImage_Buffer destBuf;
destBuf.height = dh;
@@ -354,22 +356,22 @@ jboolean clipDestCoords(
return JNI_FALSE;
}
if (*dx1 < dcx1) {
J2dTraceLn2(J2D_TRACE_VERBOSE, "\t\tdx1=%1.2f, will be clipped to %1.2f", *dx1, dcx1);
J2dTraceLn3(J2D_TRACE_VERBOSE, "\t\tdx1=%1.2f, will be clipped to %1.2f | sx1+=%d", *dx1, dcx1, (jint)((dcx1 - *dx1) * (sw/dw)));
*sx1 += (jint)((dcx1 - *dx1) * (sw/dw));
*dx1 = dcx1;
}
if (*dx2 > dcx2) {
J2dTraceLn2(J2D_TRACE_VERBOSE, "\t\tdx2=%1.2f, will be clipped to %1.2f", *dx2, dcx2);
J2dTraceLn3(J2D_TRACE_VERBOSE, "\t\tdx2=%1.2f, will be clipped to %1.2f | sx2-=%d", *dx2, dcx2, (jint)((*dx2 - dcx2) * (sw/dw)));
*sx2 -= (jint)((*dx2 - dcx2) * (sw/dw));
*dx2 = dcx2;
}
if (*dy1 < dcy1) {
J2dTraceLn2(J2D_TRACE_VERBOSE, "\t\tdy1=%1.2f, will be clipped to %1.2f", *dy1, dcy1);
J2dTraceLn3(J2D_TRACE_VERBOSE, "\t\tdy1=%1.2f, will be clipped to %1.2f | sy1+=%d", *dy1, dcy1, (jint)((dcy1 - *dy1) * (sh/dh)));
*sy1 += (jint)((dcy1 - *dy1) * (sh/dh));
*dy1 = dcy1;
}
if (*dy2 > dcy2) {
J2dTraceLn2(J2D_TRACE_VERBOSE, "\t\tdy2=%1.2f, will be clipped to %1.2f", *dy2, dcy2);
J2dTraceLn3(J2D_TRACE_VERBOSE, "\t\tdy2=%1.2f, will be clipped to %1.2f | sy2-=%d", *dy2, dcy2, (jint)((*dy2 - dcy2) * (sh/dh)));
*sy2 -= (jint)((*dy2 - dcy2) * (sh/dh));
*dy2 = dcy2;
}
@@ -2,6 +2,8 @@

#include <jni.h>
#include <simd/simd.h>
#import <ThreadUtilities.h>
#import <PropertiesUtilities.h>
#include "common.h"
#include "Trace.h"

@@ -45,3 +47,13 @@ void tracePoints(jint nPoints, jint *xPoints, jint *yPoints) {
for (int i = 0; i < nPoints; i++)
J2dTraceImpl(J2D_TRACE_INFO, JNI_TRUE, "\t(%d, %d)", *(xPoints++), *(yPoints++));
}


jboolean isOptionEnabled(const char * option) {
JNIEnv *env = [ThreadUtilities getJNIEnvUncached];

NSString * optionProp = [PropertiesUtilities
javaSystemPropertyForKey:[NSString stringWithUTF8String:option] withEnv:env];
NSString * lowerCaseProp = [optionProp localizedLowercaseString];
return [@"true" isEqual:lowerCaseProp];
}

0 comments on commit c723f09

Please sign in to comment.
You can’t perform that action at this time.