if(source->hasStencil())
{
- byte *sourceBuffer = (byte*)source->lockStencil(0, sw::PUBLIC);
- byte *destBuffer = (byte*)dest->lockStencil(0, sw::PUBLIC);
+ byte *sourceBuffer = (byte*)source->lockStencil(0, 0, 0, sw::PUBLIC);
+ byte *destBuffer = (byte*)dest->lockStencil(0, 0, 0, sw::PUBLIC);
unsigned int width = source->getWidth();
unsigned int height = source->getHeight();
{
LoadImageData<D24>(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer);
- unsigned char *stencil = reinterpret_cast<unsigned char*>(lockStencil(0, sw::PUBLIC));
+ unsigned char *stencil = reinterpret_cast<unsigned char*>(lockStencil(0, 0, 0, sw::PUBLIC));
if(stencil)
{
{
LoadImageData<D32F>(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer);
- unsigned char *stencil = reinterpret_cast<unsigned char*>(lockStencil(0, sw::PUBLIC));
+ unsigned char *stencil = reinterpret_cast<unsigned char*>(lockStencil(0, 0, 0, sw::PUBLIC));
if(stencil)
{
if(source->hasStencil())
{
- sw::byte *sourceBuffer = (sw::byte*)source->lockStencil(0, PUBLIC);
- sw::byte *destBuffer = (sw::byte*)dest->lockStencil(0, PUBLIC);
+ sw::byte *sourceBuffer = (sw::byte*)source->lockStencil(0, 0, 0, PUBLIC);
+ sw::byte *destBuffer = (sw::byte*)dest->lockStencil(0, 0, 0, PUBLIC);
unsigned int width = source->getWidth();
unsigned int height = source->getHeight();
}
}
- unsigned char *stencil = reinterpret_cast<unsigned char*>(lockStencil(0, sw::PUBLIC));
+ unsigned char *stencil = reinterpret_cast<unsigned char*>(lockStencil(0, 0, 0, sw::PUBLIC));
if(stencil)
{
if(source->hasStencil())
{
- sw::byte *sourceBuffer = (sw::byte*)source->lockStencil(0, PUBLIC);
- sw::byte *destBuffer = (sw::byte*)dest->lockStencil(0, PUBLIC);
+ sw::byte *sourceBuffer = (sw::byte*)source->lockStencil(0, 0, 0, PUBLIC);
+ sw::byte *destBuffer = (sw::byte*)dest->lockStencil(0, 0, 0, PUBLIC);
unsigned int width = source->getWidth();
unsigned int height = source->getHeight();
if(source->hasStencil())
{
- sw::byte *sourceBuffer = (sw::byte*)source->lockStencil(0, PUBLIC);
- sw::byte *destBuffer = (sw::byte*)dest->lockStencil(0, PUBLIC);
+ sw::byte *sourceBuffer = (sw::byte*)source->lockStencil(0, 0, 0, PUBLIC);
+ sw::byte *destBuffer = (sw::byte*)dest->lockStencil(0, 0, 0, PUBLIC);
copyBuffer(sourceBuffer, destBuffer, source->getWidth(), source->getHeight(), source->getInternalPitchB(), dest->getInternalPitchB(), egl::Image::bytes(source->getInternalFormat()), flipX, flipY);
if(draw->stencilBuffer)
{
- data->stencilBuffer = (unsigned char*)context->stencilBuffer->lockStencil(q * ms, MANAGED);
+ data->stencilBuffer = (unsigned char*)context->stencilBuffer->lockStencil(0, 0, q * ms, MANAGED);
data->stencilPitchB = context->stencilBuffer->getStencilPitchB();
data->stencilSliceB = context->stencilBuffer->getStencilSliceB();
}
internal.unlockRect();
}
- void *Surface::lockStencil(int front, Accessor client)
+ void *Surface::lockStencil(int x, int y, int front, Accessor client)
{
resource->lock(client);
stencil.buffer = allocateBuffer(stencil.width, stencil.height, stencil.depth, stencil.format);
}
- return stencil.lockRect(0, 0, front, LOCK_READWRITE); // FIXME
+ return stencil.lockRect(x, y, front, LOCK_READWRITE); // FIXME
}
void Surface::unlockStencil()
unsigned int fill = maskedS;
fill = fill | (fill << 8) | (fill << 16) + (fill << 24);
- char *buffer = (char*)lockStencil(0, PUBLIC);
+ char *buffer = (char*)lockStencil(0, 0, 0, PUBLIC);
// Stencil buffers are assumed to use quad layout
for(int z = 0; z < stencil.depth; z++)
inline int getInternalSliceB() const;
inline int getInternalSliceP() const;
- void *lockStencil(int front, Accessor client);
+ void *lockStencil(int x, int y, int front, Accessor client);
void unlockStencil();
+ inline Format getStencilFormat() const;
inline int getStencilPitchB() const;
inline int getStencilSliceB() const;
return internal.sliceP;
}
+ Format Surface::getStencilFormat() const
+ {
+ return stencil.format;
+ }
+
int Surface::getStencilPitchB() const
{
return stencil.pitchB;