Commit e90d4ee9 by Jamie Madill Committed by Commit Bot

Pass Context to setLabel.

This is useful for triggering a dirty state notification for Textures. It will lead to improvements for program and texture dirty bits. Bug: angleproject:2966 Change-Id: Iaba625da8a970a558f7d158bfa2f09c964f6761a Reviewed-on: https://chromium-review.googlesource.com/c/1347669 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent ef9fcd91
...@@ -58,7 +58,7 @@ void Buffer::onDestroy(const Context *context) ...@@ -58,7 +58,7 @@ void Buffer::onDestroy(const Context *context)
mImpl->destroy(context); mImpl->destroy(context);
} }
void Buffer::setLabel(const std::string &label) void Buffer::setLabel(const Context *context, const std::string &label)
{ {
mState.mLabel = label; mState.mLabel = label;
} }
......
...@@ -73,7 +73,7 @@ class Buffer final : public RefCountObject, ...@@ -73,7 +73,7 @@ class Buffer final : public RefCountObject,
~Buffer() override; ~Buffer() override;
void onDestroy(const Context *context) override; void onDestroy(const Context *context) override;
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
angle::Result bufferData(Context *context, angle::Result bufferData(Context *context,
......
...@@ -1030,7 +1030,7 @@ void Context::objectLabel(GLenum identifier, GLuint name, GLsizei length, const ...@@ -1030,7 +1030,7 @@ void Context::objectLabel(GLenum identifier, GLuint name, GLsizei length, const
ASSERT(object != nullptr); ASSERT(object != nullptr);
std::string labelName = GetObjectLabelFromPointer(length, label); std::string labelName = GetObjectLabelFromPointer(length, label);
object->setLabel(labelName); object->setLabel(this, labelName);
// TODO(jmadill): Determine if the object is dirty based on 'name'. Conservatively assume the // TODO(jmadill): Determine if the object is dirty based on 'name'. Conservatively assume the
// specified object is active until we do this. // specified object is active until we do this.
...@@ -1043,7 +1043,7 @@ void Context::objectPtrLabel(const void *ptr, GLsizei length, const GLchar *labe ...@@ -1043,7 +1043,7 @@ void Context::objectPtrLabel(const void *ptr, GLsizei length, const GLchar *labe
ASSERT(object != nullptr); ASSERT(object != nullptr);
std::string labelName = GetObjectLabelFromPointer(length, label); std::string labelName = GetObjectLabelFromPointer(length, label);
object->setLabel(labelName); object->setLabel(this, labelName);
} }
void Context::getObjectLabel(GLenum identifier, void Context::getObjectLabel(GLenum identifier,
......
...@@ -20,12 +20,13 @@ ...@@ -20,12 +20,13 @@
namespace gl namespace gl
{ {
class Context;
class LabeledObject class LabeledObject
{ {
public: public:
virtual ~LabeledObject() {} virtual ~LabeledObject() {}
virtual void setLabel(const std::string &label) = 0; virtual void setLabel(const Context *context, const std::string &label) = 0;
virtual const std::string &getLabel() const = 0; virtual const std::string &getLabel() const = 0;
}; };
......
...@@ -73,7 +73,7 @@ Sync::~Sync() ...@@ -73,7 +73,7 @@ Sync::~Sync()
SafeDelete(mFence); SafeDelete(mFence);
} }
void Sync::setLabel(const std::string &label) void Sync::setLabel(const Context *context, const std::string &label)
{ {
mLabel = label; mLabel = label;
} }
......
...@@ -56,7 +56,7 @@ class Sync final : public RefCountObject, public LabeledObject ...@@ -56,7 +56,7 @@ class Sync final : public RefCountObject, public LabeledObject
void onDestroy(const Context *context) override; void onDestroy(const Context *context) override;
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
angle::Result set(const Context *context, GLenum condition, GLbitfield flags); angle::Result set(const Context *context, GLenum condition, GLbitfield flags);
......
...@@ -707,7 +707,7 @@ void Framebuffer::onDestroy(const Context *context) ...@@ -707,7 +707,7 @@ void Framebuffer::onDestroy(const Context *context)
mImpl->destroy(context); mImpl->destroy(context);
} }
void Framebuffer::setLabel(const std::string &label) void Framebuffer::setLabel(const Context *context, const std::string &label)
{ {
mState.mLabel = label; mState.mLabel = label;
} }
......
...@@ -164,7 +164,7 @@ class Framebuffer final : public angle::ObserverInterface, ...@@ -164,7 +164,7 @@ class Framebuffer final : public angle::ObserverInterface,
~Framebuffer() override; ~Framebuffer() override;
void onDestroy(const Context *context); void onDestroy(const Context *context);
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
rx::FramebufferImpl *getImplementation() const { return mImpl; } rx::FramebufferImpl *getImplementation() const { return mImpl; }
......
...@@ -931,7 +931,7 @@ GLuint Program::id() const ...@@ -931,7 +931,7 @@ GLuint Program::id() const
return mHandle; return mHandle;
} }
void Program::setLabel(const std::string &label) void Program::setLabel(const Context *context, const std::string &label)
{ {
ASSERT(mLinkResolved); ASSERT(mLinkResolved);
mState.mLabel = label; mState.mLabel = label;
......
...@@ -497,7 +497,7 @@ class Program final : angle::NonCopyable, public LabeledObject ...@@ -497,7 +497,7 @@ class Program final : angle::NonCopyable, public LabeledObject
GLuint id() const; GLuint id() const;
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
ANGLE_INLINE rx::ProgramImpl *getImplementation() const ANGLE_INLINE rx::ProgramImpl *getImplementation() const
......
...@@ -39,7 +39,7 @@ ProgramPipeline::~ProgramPipeline() ...@@ -39,7 +39,7 @@ ProgramPipeline::~ProgramPipeline()
void ProgramPipeline::onDestroy(const Context *context) {} void ProgramPipeline::onDestroy(const Context *context) {}
void ProgramPipeline::setLabel(const std::string &label) void ProgramPipeline::setLabel(const Context *context, const std::string &label)
{ {
mState.mLabel = label; mState.mLabel = label;
} }
......
...@@ -50,7 +50,7 @@ class ProgramPipeline final : public RefCountObject, public LabeledObject ...@@ -50,7 +50,7 @@ class ProgramPipeline final : public RefCountObject, public LabeledObject
void onDestroy(const Context *context) override; void onDestroy(const Context *context) override;
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
rx::ProgramPipelineImpl *getImplementation() const; rx::ProgramPipelineImpl *getImplementation() const;
......
...@@ -24,7 +24,7 @@ void Query::onDestroy(const Context *context) ...@@ -24,7 +24,7 @@ void Query::onDestroy(const Context *context)
mQuery->onDestroy(context); mQuery->onDestroy(context);
} }
void Query::setLabel(const std::string &label) void Query::setLabel(const Context *context, const std::string &label)
{ {
mLabel = label; mLabel = label;
} }
......
...@@ -33,7 +33,7 @@ class Query final : public RefCountObject, public LabeledObject ...@@ -33,7 +33,7 @@ class Query final : public RefCountObject, public LabeledObject
~Query() override; ~Query() override;
void onDestroy(const Context *context) override; void onDestroy(const Context *context) override;
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
angle::Result begin(const Context *context); angle::Result begin(const Context *context);
......
...@@ -82,7 +82,7 @@ void Renderbuffer::onDestroy(const Context *context) ...@@ -82,7 +82,7 @@ void Renderbuffer::onDestroy(const Context *context)
Renderbuffer::~Renderbuffer() {} Renderbuffer::~Renderbuffer() {}
void Renderbuffer::setLabel(const std::string &label) void Renderbuffer::setLabel(const Context *context, const std::string &label)
{ {
mLabel = label; mLabel = label;
} }
......
...@@ -69,7 +69,7 @@ class Renderbuffer final : public RefCountObject, public egl::ImageSibling, publ ...@@ -69,7 +69,7 @@ class Renderbuffer final : public RefCountObject, public egl::ImageSibling, publ
void onDestroy(const Context *context) override; void onDestroy(const Context *context) override;
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
angle::Result setStorage(const Context *context, angle::Result setStorage(const Context *context,
......
...@@ -26,7 +26,7 @@ Sampler::~Sampler() ...@@ -26,7 +26,7 @@ Sampler::~Sampler()
void Sampler::onDestroy(const Context *context) {} void Sampler::onDestroy(const Context *context) {}
void Sampler::setLabel(const std::string &label) void Sampler::setLabel(const Context *context, const std::string &label)
{ {
mLabel = label; mLabel = label;
} }
......
...@@ -32,7 +32,7 @@ class Sampler final : public RefCountObject, public LabeledObject, public angle: ...@@ -32,7 +32,7 @@ class Sampler final : public RefCountObject, public LabeledObject, public angle:
void onDestroy(const Context *context) override; void onDestroy(const Context *context) override;
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
void setMinFilter(GLenum minFilter); void setMinFilter(GLenum minFilter);
......
...@@ -186,7 +186,7 @@ Shader::~Shader() ...@@ -186,7 +186,7 @@ Shader::~Shader()
ASSERT(!mImplementation); ASSERT(!mImplementation);
} }
void Shader::setLabel(const std::string &label) void Shader::setLabel(const Context *context, const std::string &label)
{ {
mState.mLabel = label; mState.mLabel = label;
} }
......
...@@ -131,7 +131,7 @@ class Shader final : angle::NonCopyable, public LabeledObject ...@@ -131,7 +131,7 @@ class Shader final : angle::NonCopyable, public LabeledObject
void onDestroy(const Context *context); void onDestroy(const Context *context);
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
ShaderType getType() const { return mType; } ShaderType getType() const { return mType; }
......
...@@ -627,7 +627,7 @@ Texture::~Texture() ...@@ -627,7 +627,7 @@ Texture::~Texture()
SafeDelete(mTexture); SafeDelete(mTexture);
} }
void Texture::setLabel(const std::string &label) void Texture::setLabel(const Context *context, const std::string &label)
{ {
mLabel = label; mLabel = label;
mDirtyBits.set(DIRTY_BIT_LABEL); mDirtyBits.set(DIRTY_BIT_LABEL);
......
...@@ -201,7 +201,7 @@ class Texture final : public RefCountObject, ...@@ -201,7 +201,7 @@ class Texture final : public RefCountObject,
void onDestroy(const Context *context) override; void onDestroy(const Context *context) override;
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
TextureType getType() const { return mState.mType; } TextureType getType() const { return mState.mType; }
......
...@@ -98,7 +98,7 @@ TransformFeedback::~TransformFeedback() ...@@ -98,7 +98,7 @@ TransformFeedback::~TransformFeedback()
SafeDelete(mImplementation); SafeDelete(mImplementation);
} }
void TransformFeedback::setLabel(const std::string &label) void TransformFeedback::setLabel(const Context *context, const std::string &label)
{ {
mState.mLabel = label; mState.mLabel = label;
} }
......
...@@ -60,7 +60,7 @@ class TransformFeedback final : public RefCountObject, public LabeledObject ...@@ -60,7 +60,7 @@ class TransformFeedback final : public RefCountObject, public LabeledObject
~TransformFeedback() override; ~TransformFeedback() override;
void onDestroy(const Context *context) override; void onDestroy(const Context *context) override;
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
void begin(const Context *context, PrimitiveMode primitiveMode, Program *program); void begin(const Context *context, PrimitiveMode primitiveMode, Program *program);
......
...@@ -127,7 +127,7 @@ GLuint VertexArray::id() const ...@@ -127,7 +127,7 @@ GLuint VertexArray::id() const
return mId; return mId;
} }
void VertexArray::setLabel(const std::string &label) void VertexArray::setLabel(const Context *context, const std::string &label)
{ {
mState.mLabel = label; mState.mLabel = label;
} }
......
...@@ -106,7 +106,7 @@ class VertexArray final : public angle::ObserverInterface, ...@@ -106,7 +106,7 @@ class VertexArray final : public angle::ObserverInterface,
GLuint id() const; GLuint id() const;
void setLabel(const std::string &label) override; void setLabel(const Context *context, const std::string &label) override;
const std::string &getLabel() const override; const std::string &getLabel() const override;
const VertexBinding &getVertexBinding(size_t bindingIndex) const; const VertexBinding &getVertexBinding(size_t bindingIndex) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment