diff options
author | Michael Bien <[email protected]> | 2011-06-15 16:32:27 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2011-06-15 16:32:27 +0200 |
commit | 4373f933333ecee50dea9686403b6f81759e3b07 (patch) | |
tree | bc3883f431a7e2581c80189c466362bb5d6b31f3 /src/com/jogamp/opencl/CLImage.java | |
parent | 841d04d5716cbd7ce98a482060c656b1d5050949 (diff) |
internal refactoring to use new binding interfaces in highlevel api impl.
Diffstat (limited to 'src/com/jogamp/opencl/CLImage.java')
-rw-r--r-- | src/com/jogamp/opencl/CLImage.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/com/jogamp/opencl/CLImage.java b/src/com/jogamp/opencl/CLImage.java index 82c29f7f..09b92b00 100644 --- a/src/com/jogamp/opencl/CLImage.java +++ b/src/com/jogamp/opencl/CLImage.java @@ -30,7 +30,7 @@ package com.jogamp.opencl; import com.jogamp.opencl.impl.CLTLInfoAccessor; import com.jogamp.common.nio.NativeSizeBuffer; -import com.jogamp.opencl.llb.CL; +import com.jogamp.opencl.llb.CLImageBinding; import java.nio.Buffer; import static com.jogamp.opencl.llb.CL.*; @@ -49,17 +49,21 @@ public abstract class CLImage<B extends Buffer> extends CLMemory<B> { public final int height; protected CLImage(CLContext context, B directBuffer, CLImageFormat format, int width, int height, long id, int flags) { - this(context, directBuffer, format, new CLImageInfoAccessor(context.cl, id), width, height, id, flags); + this(context, directBuffer, format, createAccessor(context, id), width, height, id, flags); } protected CLImage(CLContext context, B directBuffer, CLImageFormat format, CLImageInfoAccessor accessor, int width, int height, long id, int flags) { - super(context, directBuffer, getSizeImpl(context.cl, id), id, flags); + super(context, directBuffer, getSizeImpl(context, id), id, flags); this.imageInfo = accessor; this.format = format; this.width = width; this.height = height; } + private static CLImageInfoAccessor createAccessor(CLContext context, long id) { + return new CLImageInfoAccessor(context.getPlatform().getImageBinding(), id); + } + protected static CLImageFormat createUninitializedImageFormat() { return new CLImageFormat(); } @@ -105,9 +109,9 @@ public abstract class CLImage<B extends Buffer> extends CLMemory<B> { protected final static class CLImageInfoAccessor extends CLTLInfoAccessor { private final long id; - private final CL cl; + private final CLImageBinding cl; - public CLImageInfoAccessor(CL cl, long id) { + public CLImageInfoAccessor(CLImageBinding cl, long id) { this.cl = cl; this.id = id; } |