Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-08 05:12:12 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-08 05:15:50 +0300
commit48690d967a7731367cda01ab8dca64e7f4c3f6b5 (patch)
tree9295cc0ef083fd50eaab2c62785d54545eb004c6 /source/blender/gpu/opengl/gl_framebuffer.cc
parentd2e9de93b8d1d6cd45abce8164d0f92af8f636d0 (diff)
GPUContext: Move GPUContext to gpu::Context for more consistency
This makes the GPUContext follow the same naming convention as the rest of the module. Also add a static getter for extra bonus style (no need for casts): - Context::get() - GLContext::get()
Diffstat (limited to 'source/blender/gpu/opengl/gl_framebuffer.cc')
-rw-r--r--source/blender/gpu/opengl/gl_framebuffer.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc
index 61270fe0acc..85fa973daff 100644
--- a/source/blender/gpu/opengl/gl_framebuffer.cc
+++ b/source/blender/gpu/opengl/gl_framebuffer.cc
@@ -78,7 +78,7 @@ GLFrameBuffer::~GLFrameBuffer()
return;
}
- if (context_ == GPU_context_active_get()) {
+ if (context_ == GLContext::get()) {
/* Context might be partially freed. This happens when destroying the window frame-buffers. */
glDeleteFramebuffers(1, &fbo_id_);
}
@@ -89,14 +89,14 @@ GLFrameBuffer::~GLFrameBuffer()
if (context_->active_fb == this && context_->back_left != this) {
/* If this assert triggers it means the frame-buffer is being freed while in use by another
* context which, by the way, is TOTALLY UNSAFE!!! */
- BLI_assert(context_ == GPU_context_active_get());
+ BLI_assert(context_ == GLContext::get());
GPU_framebuffer_restore();
}
}
void GLFrameBuffer::init(void)
{
- context_ = static_cast<GLContext *>(GPU_context_active_get());
+ context_ = GLContext::get();
state_manager_ = static_cast<GLStateManager *>(context_->state_manager);
glGenFramebuffers(1, &fbo_id_);
@@ -274,7 +274,7 @@ void GLFrameBuffer::bind(bool enabled_srgb)
this->init();
}
- if (context_ != GPU_context_active_get()) {
+ if (context_ != GLContext::get()) {
BLI_assert(!"Trying to use the same frame-buffer in multiple context");
return;
}
@@ -320,7 +320,7 @@ void GLFrameBuffer::clear(eGPUFrameBufferBits buffers,
float clear_depth,
uint clear_stencil)
{
- BLI_assert(GPU_context_active_get() == context_);
+ BLI_assert(GLContext::get() == context_);
BLI_assert(context_->active_fb == this);
/* Save and restore the state. */
@@ -360,7 +360,7 @@ void GLFrameBuffer::clear_attachment(GPUAttachmentType type,
eGPUDataFormat data_format,
const void *clear_value)
{
- BLI_assert(GPU_context_active_get() == context_);
+ BLI_assert(GLContext::get() == context_);
BLI_assert(context_->active_fb == this);
/* Save and restore the state. */