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

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

Issue 1925663002: command_buffer: Defer restoring of FBO bindings when changing virtual contexts Base URL: https://chromium.googlesource.com/chromium/src.git@lazy-bindframebuffer-03-copy-texture-chromium-instantiation
Patch Set: rework Created 4 years, 8 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
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 bb0de013a807c5b251740072bfe69d96cdd1afd2..5b43acd7aa77db5d312188a051ea5f200446f96b 100644
--- a/gpu/command_buffer/service/framebuffer_manager.h
+++ b/gpu/command_buffer/service/framebuffer_manager.h
@@ -235,14 +235,45 @@ class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> {
struct DecoderFramebufferState {
DecoderFramebufferState();
~DecoderFramebufferState();
+ bool is_draw_binding_dirty() const { return draw_binding_dirty_; }
+ bool is_read_binding_dirty() const { return read_binding_dirty_; }
+
+ void set_draw_framebuffer_clear_state_dirty(bool flag) {
+ draw_framebuffer_clear_state_dirty_ = flag;
+ }
+ bool is_draw_framebuffer_clear_state_dirty() const {
+ return draw_framebuffer_clear_state_dirty_;
+ }
+
+ void set_bound_draw_framebuffer(Framebuffer* framebuffer);
+ void set_bound_read_framebuffer(Framebuffer* framebuffer);
+ Framebuffer* bound_draw_framebuffer() const {
+ return bound_draw_framebuffer_.get();
+ }
+ Framebuffer* bound_read_framebuffer() const {
+ return bound_read_framebuffer_.get();
+ }
+ void SetBoundFramebuffer(GLenum target, Framebuffer* framebuffer);
+ bool IsBindingDirty(GLenum target) const;
+ void MarkBindingDirty(GLenum target);
+ void MarkBindingClean(GLenum target);
+
+ void NotifyFramebufferChanged(Framebuffer* framebuffer);
+ void NotifyBoundFramebuffersChanged();
+
+ private:
+ // OpenGL FBO bindings have been modified and do not reflect
+ // bound_read_framebuffer and bound_draw_framebuffer.
+ bool draw_binding_dirty_;
+ bool read_binding_dirty_;
// State saved for clearing so we can clear render buffers and then
// restore to these values.
- bool clear_state_dirty;
+ bool draw_framebuffer_clear_state_dirty_;
// The currently bound framebuffers
- scoped_refptr<Framebuffer> bound_read_framebuffer;
- scoped_refptr<Framebuffer> bound_draw_framebuffer;
+ scoped_refptr<Framebuffer> bound_read_framebuffer_;
+ scoped_refptr<Framebuffer> bound_draw_framebuffer_;
};
// This class keeps track of the frambebuffers and their attached renderbuffers

Powered by Google App Engine
This is Rietveld 408576698