diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-12 23:19:03 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-12 23:19:03 +0400 |
commit | 8b8bc164dafdfc5fd2f5967ea3cfe07c0193f570 (patch) | |
tree | 140a4080c8825d8fb74bbd1c2724b19446f788d5 /source/blender/compositor/intern | |
parent | 2738fa99e73699f3ea202086506fe53aa651e901 (diff) |
Small optimizations in compositor.
Most of them are not noticeable.
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r-- | source/blender/compositor/intern/COM_MemoryBuffer.cpp | 4 | ||||
-rw-r--r-- | source/blender/compositor/intern/COM_SingleThreadedNodeOperation.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp index 572308dd87f..0aae8853795 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp @@ -121,7 +121,7 @@ void MemoryBuffer::writePixel(int x, int y, const float color[4]) if (x >= this->m_rect.xmin && x < this->m_rect.xmax && y >= this->m_rect.ymin && y < this->m_rect.ymax) { - const int offset = (this->m_chunkWidth * y + x) * COM_NUMBER_OF_CHANNELS; + const int offset = (this->m_chunkWidth * (y-this->m_rect.ymin) + x-this->m_rect.xmin) * COM_NUMBER_OF_CHANNELS; copy_v4_v4(&this->m_buffer[offset], color); } } @@ -131,7 +131,7 @@ void MemoryBuffer::addPixel(int x, int y, const float color[4]) if (x >= this->m_rect.xmin && x < this->m_rect.xmax && y >= this->m_rect.ymin && y < this->m_rect.ymax) { - const int offset = (this->m_chunkWidth * y + x) * COM_NUMBER_OF_CHANNELS; + const int offset = (this->m_chunkWidth * (y-this->m_rect.ymin) + x-this->m_rect.xmin) * COM_NUMBER_OF_CHANNELS; add_v4_v4(&this->m_buffer[offset], color); } } diff --git a/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.cpp b/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.cpp index a6f81410b74..0496974c64f 100644 --- a/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.cpp +++ b/source/blender/compositor/intern/COM_SingleThreadedNodeOperation.cpp @@ -35,7 +35,7 @@ void SingleThreadedNodeOperation::initExecution() void SingleThreadedNodeOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data) { - this->m_cachedInstance->read(color, x, y); + this->m_cachedInstance->readNoCheck(color, x, y); } void SingleThreadedNodeOperation::deinitExecution() |