diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-11 14:45:56 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-11 14:45:56 +0400 |
commit | c25240ad547e579381b8ae4cdb7b7b961d0af2cb (patch) | |
tree | 408cdbff6919db8a8a06658633351e164e3b5ee2 /source/blender/compositor/operations/COM_ReadBufferOperation.cpp | |
parent | 74625c8d54cf19f4eac4a007cc2a8b3b56f621b2 (diff) |
Compositor read buffers work directly on the memory buffer.
This way we can remove the memoryBuffers parameter in the executePixels,
and (de)initializeTileData methods
Diffstat (limited to 'source/blender/compositor/operations/COM_ReadBufferOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_ReadBufferOperation.cpp | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp index 76e6921503e..882d302656d 100644 --- a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp +++ b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp @@ -28,11 +28,12 @@ ReadBufferOperation::ReadBufferOperation() : NodeOperation() { this->addOutputSocket(COM_DT_COLOR); this->m_offset = 0; + this->m_buffer = NULL; } void *ReadBufferOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers) { - return getInputMemoryBuffer(memoryBuffers); + return m_buffer; } void ReadBufferOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) @@ -50,30 +51,17 @@ void ReadBufferOperation::determineResolution(unsigned int resolution[], unsigne } void ReadBufferOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) { - if (inputBuffers) { - MemoryBuffer *inputBuffer = inputBuffers[this->m_offset]; - if (inputBuffer) { - if (sampler == COM_PS_NEAREST) { - inputBuffer->read(color, x, y); - } - else { - inputBuffer->readCubic(color, x, y); - } - } - } else { - color[0] = 0.0f; - color[1] = 0.0f; - color[2] = 0.0f; - color[3] = 0.0f; + if (sampler == COM_PS_NEAREST) { + m_buffer->read(color, x, y); + } + else { + m_buffer->readCubic(color, x, y); } } void ReadBufferOperation::executePixel(float *color, float x, float y, float dx, float dy, MemoryBuffer *inputBuffers[]) { - MemoryBuffer *inputBuffer = inputBuffers[this->m_offset]; - if (inputBuffer) { - inputBuffer->readEWA(color, x, y, dx, dy); - } + m_buffer->readEWA(color, x, y, dx, dy); } bool ReadBufferOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) @@ -93,3 +81,9 @@ void ReadBufferOperation::readResolutionFromWriteBuffer() this->setHeight(operation->getHeight()); } } + +void ReadBufferOperation::updateMemoryBuffer() +{ + this->m_buffer = this->getMemoryProxy()->getBuffer(); + +} |