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

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

Issue 7099007: Enforce RGB even on buggy drivers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add checks for reading GL_ALPHA_BITS etc. Created 9 years, 6 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 | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/texture_manager.h
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index 6b7ff12bd7846b3e1847abe4735331e871738559..2fc1cb9d381b588ca3191bfd8e905de34c8bd9a0 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -42,6 +42,7 @@ class TextureManager {
cube_complete_(false),
npot_(false),
has_been_bound_(false),
+ framebuffer_attachment_count_(0),
owned_(true) {
}
@@ -131,6 +132,19 @@ class TextureManager {
owned_ = false;
}
+ bool IsAttachedToFramebuffer() const {
+ return framebuffer_attachment_count_ != 0;
+ }
+
+ void AttachToFramebuffer() {
+ ++framebuffer_attachment_count_;
+ }
+
+ void DetachFromFramebuffer() {
+ DCHECK(framebuffer_attachment_count_ > 0);
+ --framebuffer_attachment_count_;
+ }
+
private:
friend class TextureManager;
friend class base::RefCounted<TextureInfo>;
@@ -240,6 +254,9 @@ class TextureManager {
// Whether this texture has ever been bound.
bool has_been_bound_;
+ // The number of framebuffers this texture is attached to.
+ int framebuffer_attachment_count_;
+
// Whether the associated context group owns this texture and should delete
// it.
bool owned_;
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698