Skip to content

Commit

Permalink
removed sysout references
Browse files Browse the repository at this point in the history
  • Loading branch information
redrezo committed Jul 27, 2020
1 parent 9baa397 commit f567d02
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public static void initialize(long es2ContextHandle) {
if (!initialized) {
context = syncExecute(() -> {
// TODO context version should be same as fx!!
System.out.println("QuantumRendererHelper: creating shared context for " + es2ContextHandle);
Log.info("QuantumRendererHelper: creating shared context for " + es2ContextHandle);
long es2Context = GL.wrapContext(es2ContextHandle);
long context = GL.createSharedCompatContext(es2Context);
boolean result = GL.makeContextCurrent(context);
System.out.println("=> " + result);
Log.info("=> " + result);
return context;
});
initialized = true;
Expand Down Expand Up @@ -97,9 +97,7 @@ static void internalSyncExecute(Runnable r) {
lock.lock();
executor.execute(() -> {
lock.lock();
System.out.println(" ==>");
r.run();
System.out.println(" ***");
done.signal();
lock.unlock();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public Vec2i getSize() {

@Override
public Swapchain createSwapchain(SwapchainConfig config) {
System.out.println("java createSwapchain(" + config +")");
Log.info("java createSwapchain(" + config +")");
return backend.createSwapchain(config);
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
package org.eclipse.fx.drift.internal.backend;

import static org.eclipse.fx.drift.internal.GL.*;
import static org.eclipse.fx.drift.internal.SYS.*;
import static org.eclipse.fx.drift.internal.GL.GL_BGRA;
import static org.eclipse.fx.drift.internal.GL.GL_PIXEL_PACK_BUFFER;
import static org.eclipse.fx.drift.internal.GL.GL_READ_ONLY;
import static org.eclipse.fx.drift.internal.GL.GL_RGBA;
import static org.eclipse.fx.drift.internal.GL.GL_STATIC_READ;
import static org.eclipse.fx.drift.internal.GL.GL_TEXTURE_2D;
import static org.eclipse.fx.drift.internal.GL.GL_UNSIGNED_BYTE;
import static org.eclipse.fx.drift.internal.GL.GL_UNSIGNED_INT_8_8_8_8_REV;
import static org.eclipse.fx.drift.internal.GL.glBindBuffer;
import static org.eclipse.fx.drift.internal.GL.glBindTexture;
import static org.eclipse.fx.drift.internal.GL.glBufferData;
import static org.eclipse.fx.drift.internal.GL.glDeleteBuffer;
import static org.eclipse.fx.drift.internal.GL.glDeleteTexture;
import static org.eclipse.fx.drift.internal.GL.glGenBuffer;
import static org.eclipse.fx.drift.internal.GL.glGenTexture;
import static org.eclipse.fx.drift.internal.GL.glGetTexImage;
import static org.eclipse.fx.drift.internal.GL.glMapBuffer;
import static org.eclipse.fx.drift.internal.GL.glTexImage2D;
import static org.eclipse.fx.drift.internal.GL.glUnmapBuffer;
import static org.eclipse.fx.drift.internal.SYS.free;
import static org.eclipse.fx.drift.internal.SYS.malloc;
import static org.eclipse.fx.drift.internal.SYS.memcpy;

import org.eclipse.fx.drift.Vec2i;
import org.eclipse.fx.drift.internal.Log;
import org.eclipse.fx.drift.internal.common.ImageData;
import org.eclipse.fx.drift.internal.common.MainMemoryImageData;
import org.eclipse.fx.drift.internal.prism.Prism;
Expand Down Expand Up @@ -42,16 +63,14 @@ public void allocate() {
memSize = size.x * size.y * 4;
memPointer = malloc(memSize);

System.out.println("*allocated " + number + " 0x" + Long.toHexString(memPointer) + "("+size.x+"x"+size.y+": " + memSize + "B)");
System.out.flush();
Log.debug("*allocated " + number + " 0x" + Long.toHexString(memPointer) + "("+size.x+"x"+size.y+": " + memSize + "B)");
this.data = new MainMemoryImageData(number, size, memPointer, memSize);
}

@Override
public void release() {
glDeleteTexture(glTexture);
System.out.println("*release " + glTexture + " 0x" + Long.toHexString(memPointer));
System.out.flush();
Log.debug("*release " + glTexture + " 0x" + Long.toHexString(memPointer));
free(memPointer);
}

Expand All @@ -78,8 +97,7 @@ private void downloadToMemorySimple(int tex, long pPixels) {
glBindTexture(GL_TEXTURE_2D, glTexture);
glGetTexImage(GL_TEXTURE_2D, 0, format, GL_UNSIGNED_INT_8_8_8_8_REV, memPointer);
glBindTexture(GL_TEXTURE_2D, 0);
System.out.println("*downloaded " + tex + " => 0x" + Long.toHexString(memPointer));
System.out.flush();
Log.debug("*downloaded " + tex + " => 0x" + Long.toHexString(memPointer));
}

private void downloadToMemoryBuf(int tex, int size, long pPixels) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static org.eclipse.fx.drift.internal.GL.glPixelStorei;
import static org.eclipse.fx.drift.internal.GL.glTexImage2D;

import org.eclipse.fx.drift.internal.Log;
import org.eclipse.fx.drift.internal.common.MainMemoryImageData;
import org.eclipse.fx.drift.internal.prism.PrismES2;

Expand All @@ -24,10 +25,9 @@ public ES2MainMemoryFxImage(MainMemoryImageData data) {
@Override
protected void uploadTexture() {
int targetTex = PrismES2.getTextureName(getTexture());
System.out.println("*uploadTexture 0x" + Long.toHexString(data.memPointer) + " => " + targetTex);
System.out.println(" with Unpack.alignment = " + glGetInteger(GL_UNPACK_ALIGNMENT));
System.out.println(" with Unpack.rowLength = " + glGetInteger(GL_UNPACK_ROW_LENGTH));
System.out.flush();
Log.info("*uploadTexture 0x" + Long.toHexString(data.memPointer) + " => " + targetTex);
Log.info(" with Unpack.alignment = " + glGetInteger(GL_UNPACK_ALIGNMENT));
Log.info(" with Unpack.rowLength = " + glGetInteger(GL_UNPACK_ROW_LENGTH));
synchronized (data) {
uploadTexture(targetTex, data.size.x, data.size.y, data.memPointer, data.memSize);
}
Expand All @@ -36,9 +36,9 @@ protected void uploadTexture() {
private void uploadTexture(int targetTex, int width, int height, long pPixels, int size) {
// System.err.println("*uploadTexture(" + targetTex + ", " + width + ", " + height + ", " + Long.toHexString(pPixels) + ", " + size + ")");
if (targetTex == 0) {
System.err.println(" ! Invalid Texture ID");
Log.error(" ! Invalid Texture ID");
}
System.out.println("isTexture(" + targetTex + "): " + glIsTexture(targetTex));
Log.info("isTexture(" + targetTex + "): " + glIsTexture(targetTex));
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glBindTexture(GL_TEXTURE_2D, targetTex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import static org.eclipse.fx.drift.internal.GL.glGetTexImage;
import static org.eclipse.fx.drift.internal.GL.glMapBuffer;
import static org.eclipse.fx.drift.internal.GL.glUnmapBuffer;
import static org.eclipse.fx.drift.internal.SYS.malloc;
import static org.eclipse.fx.drift.internal.SYS.memcpy;
import static org.eclipse.fx.drift.internal.jni.macos.MacOS.CFRelease;
import static org.eclipse.fx.drift.internal.jni.macos.MacOS.CGLGetCurrentContext;
Expand All @@ -42,8 +41,8 @@

import org.eclipse.fx.drift.Vec2i;
import org.eclipse.fx.drift.internal.GL;
import org.eclipse.fx.drift.internal.Log;
import org.eclipse.fx.drift.internal.QuantumHelper;
import org.eclipse.fx.drift.internal.SYS;
import org.eclipse.fx.drift.internal.common.IOSurfaceImageData;
import org.eclipse.fx.drift.internal.jni.MemoryStack;
import org.eclipse.fx.drift.internal.jni.macos.MacOS;
Expand Down Expand Up @@ -251,8 +250,7 @@ private static void downloadToMemorySimple(int target, int tex, long pPixels) {
glBindTexture(target, tex);
glGetTexImage(target, 0, format, GL_UNSIGNED_INT_8_8_8_8_REV, pPixels);
glBindTexture(target, 0);
System.out.println("*downloaded " + tex + " => 0x" + Long.toHexString(pPixels));
System.out.flush();
Log.info("*downloaded " + tex + " => 0x" + Long.toHexString(pPixels));
}

private static void downloadToMemoryBuf(int tex, int size, long pPixels) {
Expand Down

0 comments on commit f567d02

Please sign in to comment.