Refactor Signal utils into template classes.
This will allow us to pass on extra information to the receiving end,
such as the specific texture levels that are dirty.
BUG=angleproject:1635
Change-Id: Idb7ca1d625499e50e7712c458b694f6e9bfc0595
Reviewed-on: https://chromium-review.googlesource.com/453382
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/Framebuffer.h b/src/libANGLE/Framebuffer.h
index a2d7606..c4cacf9 100644
--- a/src/libANGLE/Framebuffer.h
+++ b/src/libANGLE/Framebuffer.h
@@ -115,7 +115,10 @@
bool mWebGLDepthStencilConsistent;
};
-class Framebuffer final : public LabeledObject, public angle::SignalReceiver
+using OnAttachmentDirtyReceiver = angle::SignalReceiver<>;
+using OnAttachmentDirtyBinding = angle::ChannelBinding<>;
+
+class Framebuffer final : public LabeledObject, public OnAttachmentDirtyReceiver
{
public:
// Constructor to build application-defined framebuffers
@@ -239,7 +242,7 @@
GLbitfield mask,
GLenum filter);
- enum DirtyBitType
+ enum DirtyBitType : uint32_t
{
DIRTY_BIT_COLOR_ATTACHMENT_0,
DIRTY_BIT_COLOR_ATTACHMENT_MAX =
@@ -262,7 +265,7 @@
void syncState(const Context *context);
// angle::SignalReceiver implementation
- void signal(angle::SignalToken token) override;
+ void signal(uint32_t token) override;
bool formsRenderingFeedbackLoopWith(const State &state) const;
bool formsCopyingFeedbackLoopWith(GLuint copyTextureID,
@@ -288,9 +291,9 @@
GLuint mId;
Optional<GLenum> mCachedStatus;
- std::vector<angle::ChannelBinding> mDirtyColorAttachmentBindings;
- angle::ChannelBinding mDirtyDepthAttachmentBinding;
- angle::ChannelBinding mDirtyStencilAttachmentBinding;
+ std::vector<OnAttachmentDirtyBinding> mDirtyColorAttachmentBindings;
+ OnAttachmentDirtyBinding mDirtyDepthAttachmentBinding;
+ OnAttachmentDirtyBinding mDirtyStencilAttachmentBinding;
DirtyBits mDirtyBits;
};