Skip to content
This repository has been archived by the owner. It is now read-only.

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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];
}