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

Side by Side Diff: trunk/src/gpu/command_buffer/service/framebuffer_manager.cc

Issue 382003004: Revert 282393 "Do not call glDrawBuffersARB when the extension i..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/src/gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/framebuffer_manager.h" 5 #include "gpu/command_buffer/service/framebuffer_manager.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
9 #include "gpu/command_buffer/service/renderbuffer_manager.h" 9 #include "gpu/command_buffer/service/renderbuffer_manager.h"
10 #include "gpu/command_buffer/service/texture_manager.h" 10 #include "gpu/command_buffer/service/texture_manager.h"
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 it->first < GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_) { 367 it->first < GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_) {
368 const Attachment* attachment = it->second.get(); 368 const Attachment* attachment = it->second.get();
369 if (!attachment->cleared()) 369 if (!attachment->cleared())
370 return true; 370 return true;
371 } 371 }
372 } 372 }
373 return false; 373 return false;
374 } 374 }
375 375
376 void Framebuffer::ChangeDrawBuffersHelper(bool recover) const { 376 void Framebuffer::ChangeDrawBuffersHelper(bool recover) const {
377 // There will always be only one buffer, GL_COLOR_ATTACHMENT0, if
378 // GL_ARB_draw_buffers is not present, even if this FBO has no attachment.
379 if (!gfx::g_driver_gl.ext.b_GL_ARB_draw_buffers)
380 return;
381
382 scoped_ptr<GLenum[]> buffers(new GLenum[manager_->max_draw_buffers_]); 377 scoped_ptr<GLenum[]> buffers(new GLenum[manager_->max_draw_buffers_]);
383 for (uint32 i = 0; i < manager_->max_draw_buffers_; ++i) 378 for (uint32 i = 0; i < manager_->max_draw_buffers_; ++i)
384 buffers[i] = GL_NONE; 379 buffers[i] = GL_NONE;
385 for (AttachmentMap::const_iterator it = attachments_.begin(); 380 for (AttachmentMap::const_iterator it = attachments_.begin();
386 it != attachments_.end(); ++it) { 381 it != attachments_.end(); ++it) {
387 if (it->first >= GL_COLOR_ATTACHMENT0 && 382 if (it->first >= GL_COLOR_ATTACHMENT0 &&
388 it->first < GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_) { 383 it->first < GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_) {
389 buffers[it->first - GL_COLOR_ATTACHMENT0] = it->first; 384 buffers[it->first - GL_COLOR_ATTACHMENT0] = it->first;
390 } 385 }
391 } 386 }
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 ++it) { 735 ++it) {
741 TextureDetachObserver* observer = *it; 736 TextureDetachObserver* observer = *it;
742 observer->OnTextureRefDetachedFromFramebuffer(texture); 737 observer->OnTextureRefDetachedFromFramebuffer(texture);
743 } 738 }
744 } 739 }
745 740
746 } // namespace gles2 741 } // namespace gles2
747 } // namespace gpu 742 } // namespace gpu
748 743
749 744
OLDNEW
« no previous file with comments | « no previous file | trunk/src/gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698