referenceCount = 1;\r
}\r
\r
- Image(Texture *parentTexture, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type)\r
- : sw::Surface(getParentResource(parentTexture), width, height, depth, SelectInternalFormat(format, type), true, true),\r
+ Image(Texture *parentTexture, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pitchP = 0)\r
+ : sw::Surface(getParentResource(parentTexture), width, height, depth, SelectInternalFormat(format, type), true, true, pitchP),\r
width(width), height(height), format(format), type(type), internalFormat(SelectInternalFormat(format, type)), depth(depth),\r
parentTexture(parentTexture)\r
{\r
explicit AndroidNativeImage(ANativeWindowBuffer *nativeBuffer)\r
: egl::Image(0, nativeBuffer->width, nativeBuffer->height, 1,\r
GLPixelFormatFromAndroid(nativeBuffer->format),\r
- GLPixelTypeFromAndroid(nativeBuffer->format)),\r
+ GLPixelTypeFromAndroid(nativeBuffer->format),\r
+ nativeBuffer->stride),\r
nativeBuffer(nativeBuffer)\r
-{\r
- nativeBuffer->common.incRef(&nativeBuffer->common);\r
- markShared();\r
-}\r
+ {\r
+ nativeBuffer->common.incRef(&nativeBuffer->common);\r
+ markShared();\r
+ }\r
\r
private:\r
ANativeWindowBuffer *nativeBuffer;\r
paletteUsed = 0;
}
- Surface::Surface(Resource *texture, int width, int height, int depth, Format format, bool lockable, bool renderTarget) : lockable(lockable), renderTarget(renderTarget)
+ Surface::Surface(Resource *texture, int width, int height, int depth, Format format, bool lockable, bool renderTarget, int pitchPprovided) : lockable(lockable), renderTarget(renderTarget)
{
resource = texture ? texture : new Resource(0);
hasParent = texture != 0;
internal.depth = depth;
internal.format = selectInternalFormat(format);
internal.bytes = bytes(internal.format);
- internal.pitchB = pitchB(internal.width, internal.format, renderTarget);
- internal.pitchP = pitchP(internal.width, internal.format, renderTarget);
+ internal.pitchB = !pitchPprovided ? pitchB(internal.width, internal.format, renderTarget) : pitchPprovided * internal.bytes;
+ internal.pitchP = !pitchPprovided ? pitchP(internal.width, internal.format, renderTarget) : pitchPprovided;
internal.sliceB = sliceB(internal.width, internal.height, internal.format, renderTarget);
internal.sliceP = sliceP(internal.width, internal.height, internal.format, renderTarget);
internal.lock = LOCK_UNLOCKED;
int sliceP;\r
Format format;\r
Lock lock;\r
- \r
+\r
bool dirty;\r
};\r
\r
public:\r
Surface(int width, int height, int depth, Format format, void *pixels, int pitch, int slice);\r
- Surface(Resource *texture, int width, int height, int depth, Format format, bool lockable, bool renderTarget);\r
- \r
+ Surface(Resource *texture, int width, int height, int depth, Format format, bool lockable, bool renderTarget, int pitchP = 0);\r
+\r
virtual ~Surface();\r
\r
inline void *lock(int x, int y, int z, Lock lock, Accessor client, bool internal = false);\r