| Index: gpu/command_buffer/service/framebuffer_manager.cc
|
| diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc
|
| index 0ce9df075ec63e8553f2281c55cfccc673a153f9..7ca3e659ada5e75eefc957cb865772d42e8c1f58 100644
|
| --- a/gpu/command_buffer/service/framebuffer_manager.cc
|
| +++ b/gpu/command_buffer/service/framebuffer_manager.cc
|
| @@ -49,6 +49,11 @@ class RenderbufferAttachment
|
| return false;
|
| }
|
|
|
| + virtual bool IsRenderbuffer(
|
| + RenderbufferManager::RenderbufferInfo* renderbuffer) const {
|
| + return renderbuffer_ == renderbuffer;
|
| + }
|
| +
|
| virtual bool CanRenderTo() const {
|
| return true;
|
| }
|
| @@ -123,6 +128,11 @@ class TextureAttachment
|
| return texture == texture_.get();
|
| }
|
|
|
| + virtual bool IsRenderbuffer(
|
| + RenderbufferManager::RenderbufferInfo* /* renderbuffer */) const {
|
| + return false;
|
| + }
|
| +
|
| TextureManager::TextureInfo* texture() const {
|
| return texture_.get();
|
| }
|
| @@ -284,6 +294,44 @@ bool FramebufferManager::FramebufferInfo::IsCleared() const {
|
| return true;
|
| }
|
|
|
| +void FramebufferManager::FramebufferInfo::UnbindRenderbuffer(
|
| + GLenum target, RenderbufferManager::RenderbufferInfo* renderbuffer) {
|
| + bool done;
|
| + do {
|
| + done = true;
|
| + for (AttachmentMap::const_iterator it = attachments_.begin();
|
| + it != attachments_.end(); ++it) {
|
| + Attachment* attachment = it->second;
|
| + if (attachment->IsRenderbuffer(renderbuffer)) {
|
| + // TODO(gman): manually detach renderbuffer.
|
| + // glFramebufferRenderbufferEXT(target, it->first, GL_RENDERBUFFER, 0);
|
| + AttachRenderbuffer(it->first, NULL);
|
| + done = false;
|
| + break;
|
| + }
|
| + }
|
| + } while (!done);
|
| +}
|
| +
|
| +void FramebufferManager::FramebufferInfo::UnbindTexture(
|
| + GLenum target, TextureManager::TextureInfo* texture) {
|
| + bool done;
|
| + do {
|
| + done = true;
|
| + for (AttachmentMap::const_iterator it = attachments_.begin();
|
| + it != attachments_.end(); ++it) {
|
| + Attachment* attachment = it->second;
|
| + if (attachment->IsTexture(texture)) {
|
| + // TODO(gman): manually detach texture.
|
| + // glFramebufferTexture2DEXT(target, it->first, GL_TEXTURE_2D, 0, 0);
|
| + AttachTexture(it->first, NULL, GL_TEXTURE_2D, 0);
|
| + done = false;
|
| + break;
|
| + }
|
| + }
|
| + } while (!done);
|
| +}
|
| +
|
| FramebufferManager::FramebufferInfo* FramebufferManager::GetFramebufferInfo(
|
| GLuint client_id) {
|
| FramebufferInfoMap::iterator it = framebuffer_infos_.find(client_id);
|
|
|