Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
49 lines
1007 B
C++
49 lines
1007 B
C++
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright 2011 Blender Foundation. */
|
|
|
|
#include "COM_SingleThreadedOperation.h"
|
|
|
|
namespace blender::compositor {
|
|
|
|
SingleThreadedOperation::SingleThreadedOperation()
|
|
{
|
|
cached_instance_ = nullptr;
|
|
flags_.complex = true;
|
|
flags_.single_threaded = true;
|
|
}
|
|
|
|
void SingleThreadedOperation::init_execution()
|
|
{
|
|
init_mutex();
|
|
}
|
|
|
|
void SingleThreadedOperation::execute_pixel(float output[4], int x, int y, void * /*data*/)
|
|
{
|
|
cached_instance_->read_no_check(output, x, y);
|
|
}
|
|
|
|
void SingleThreadedOperation::deinit_execution()
|
|
{
|
|
deinit_mutex();
|
|
if (cached_instance_) {
|
|
delete cached_instance_;
|
|
cached_instance_ = nullptr;
|
|
}
|
|
}
|
|
void *SingleThreadedOperation::initialize_tile_data(rcti *rect)
|
|
{
|
|
if (cached_instance_) {
|
|
return cached_instance_;
|
|
}
|
|
|
|
lock_mutex();
|
|
if (cached_instance_ == nullptr) {
|
|
//
|
|
cached_instance_ = create_memory_buffer(rect);
|
|
}
|
|
unlock_mutex();
|
|
return cached_instance_;
|
|
}
|
|
|
|
} // namespace blender::compositor
|