Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: gpu/command_buffer/service/framebuffer_manager.h

Issue 1418483003: Revert of ui: Move GLImage::BindTexImage fallback from GLImage implementations to GLES2CmdDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/stream_texture_android.cc ('k') | gpu/command_buffer/service/framebuffer_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/framebuffer_manager.h
diff --git a/gpu/command_buffer/service/framebuffer_manager.h b/gpu/command_buffer/service/framebuffer_manager.h
index db78ffeb6328476a9a415c05d66aa65864307ae9..7216654e86c26accb91309133e49077a279598ff 100644
--- a/gpu/command_buffer/service/framebuffer_manager.h
+++ b/gpu/command_buffer/service/framebuffer_manager.h
@@ -52,6 +52,8 @@
virtual size_t GetSignatureSize(TextureManager* texture_manager) const = 0;
virtual void AddToSignature(
TextureManager* texture_manager, std::string* signature) const = 0;
+ virtual void OnWillRenderTo() const = 0;
+ virtual void OnDidRenderTo() const = 0;
virtual bool FormsFeedbackLoop(TextureRef* texture, GLint level) const = 0;
protected:
@@ -158,6 +160,13 @@
// formats.
bool HasSameInternalFormatsMRT() const;
+ void OnTextureRefDetached(TextureRef* texture);
+
+ // If attachment is 0, apply to all attachments; otherwise, apply only to
+ // the specified attachment.
+ void OnWillRenderTo(GLenum attachment) const;
+ void OnDidRenderTo(GLenum attachment) const;
+
void set_read_buffer(GLenum read_buffer) {
read_buffer_ = read_buffer;
}
@@ -233,6 +242,17 @@
// so we can correctly clear them.
class GPU_EXPORT FramebufferManager {
public:
+ class GPU_EXPORT TextureDetachObserver {
+ public:
+ TextureDetachObserver();
+ virtual ~TextureDetachObserver();
+
+ virtual void OnTextureRefDetachedFromFramebuffer(TextureRef* texture) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TextureDetachObserver);
+ };
+
FramebufferManager(uint32 max_draw_buffers,
uint32 max_color_attachments,
ContextType context_type,
@@ -270,6 +290,18 @@
(framebuffer_state_change_count_ + 1) | 0x80000000U;
}
+ void AddObserver(TextureDetachObserver* observer) {
+ texture_detach_observers_.push_back(observer);
+ }
+
+ void RemoveObserver(TextureDetachObserver* observer) {
+ texture_detach_observers_.erase(
+ std::remove(texture_detach_observers_.begin(),
+ texture_detach_observers_.end(),
+ observer),
+ texture_detach_observers_.end());
+ }
+
ContextType context_type() const { return context_type_; }
private:
@@ -277,6 +309,8 @@
void StartTracking(Framebuffer* framebuffer);
void StopTracking(Framebuffer* framebuffer);
+
+ void OnTextureRefDetached(TextureRef* texture);
FramebufferCompletenessCache* GetFramebufferComboCompleteCache() {
return framebuffer_combo_complete_cache_.get();
@@ -302,6 +336,9 @@
ContextType context_type_;
+ typedef std::vector<TextureDetachObserver*> TextureDetachObserverVector;
+ TextureDetachObserverVector texture_detach_observers_;
+
scoped_refptr<FramebufferCompletenessCache> framebuffer_combo_complete_cache_;
DISALLOW_COPY_AND_ASSIGN(FramebufferManager);
« no previous file with comments | « content/common/gpu/stream_texture_android.cc ('k') | gpu/command_buffer/service/framebuffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698