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/COM_MemoryBuffer.cpp | |
parent | 2738fa99e73699f3ea202086506fe53aa651e901 (diff) |
Small optimizations in compositor.
Most of them are not noticeable.
Diffstat (limited to 'source/blender/compositor/intern/COM_MemoryBuffer.cpp')
-rw-r--r-- | source/blender/compositor/intern/COM_MemoryBuffer.cpp | 4 |
1 files changed, 2 insertions, 2 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); } } |