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

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

Issue 6028005: Make CopyTexImage2D and CopyTexSubImage2D fail if... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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/common/gles2_cmd_utils.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
===================================================================
--- gpu/command_buffer/service/framebuffer_manager.h (revision 69969)
+++ gpu/command_buffer/service/framebuffer_manager.h (working copy)
@@ -11,6 +11,7 @@
#include "base/scoped_ptr.h"
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/renderbuffer_manager.h"
+#include "gpu/command_buffer/service/texture_manager.h"
namespace gpu {
namespace gles2 {
@@ -24,6 +25,19 @@
public:
typedef scoped_refptr<FramebufferInfo> Ref;
+ class Attachment : public base::RefCounted<Attachment> {
+ public:
+ typedef scoped_refptr<Attachment> Ref;
+
+ virtual ~Attachment() { }
+ virtual GLsizei width() const = 0;
+ virtual GLsizei height() const = 0;
+ virtual GLenum internal_format() const = 0;
+ virtual GLsizei samples() const = 0;
+ virtual bool cleared() const = 0;
+ virtual void set_cleared() = 0;
+ };
+
explicit FramebufferInfo(GLuint service_id);
GLuint service_id() const {
@@ -37,8 +51,15 @@
void AttachRenderbuffer(
GLenum attachment, RenderbufferManager::RenderbufferInfo* renderbuffer);
+ // Attaches a texture to a particlar attachment. Pass null to detach.
+ void AttachTexture(
+ GLenum attachment, TextureManager::TextureInfo* texture, GLenum target,
+ GLint level);
+
void MarkAttachedRenderbuffersAsCleared();
+ const Attachment* GetAttachment(GLenum attachment) const;
+
bool IsDeleted() {
return service_id_ == 0;
}
@@ -51,16 +72,17 @@
void MarkAsDeleted() {
service_id_ = 0;
- renderbuffers_.clear();
+ attachments_.clear();
}
// Service side framebuffer id.
GLuint service_id_;
- // A map of attachments to renderbuffers.
- typedef std::map<GLenum, RenderbufferManager::RenderbufferInfo::Ref>
- AttachmentToRenderbufferMap;
- AttachmentToRenderbufferMap renderbuffers_;
+ // A map of attachments.
+ typedef std::map<GLenum, Attachment::Ref> AttachmentMap;
+ AttachmentMap attachments_;
+
+ DISALLOW_COPY_AND_ASSIGN(FramebufferInfo);
};
FramebufferManager();
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.cc ('k') | gpu/command_buffer/service/framebuffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698