OLD | NEW |
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 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 DCHECK(GLES2Util::IsSignedIntegerFormat(internal_format)); | 431 DCHECK(GLES2Util::IsSignedIntegerFormat(internal_format)); |
432 const static GLint kZero[] = { 0, 0, 0, 0 }; | 432 const static GLint kZero[] = { 0, 0, 0, 0 }; |
433 glClearBufferiv(GL_COLOR, drawbuffer, kZero); | 433 glClearBufferiv(GL_COLOR, drawbuffer, kZero); |
434 } | 434 } |
435 it->second->SetCleared(renderbuffer_manager, nullptr, true); | 435 it->second->SetCleared(renderbuffer_manager, nullptr, true); |
436 } | 436 } |
437 } | 437 } |
438 } | 438 } |
439 | 439 |
440 bool Framebuffer::PrepareDrawBuffersForClear() const { | 440 bool Framebuffer::PrepareDrawBuffersForClear() const { |
441 scoped_ptr<GLenum[]> buffers(new GLenum[manager_->max_draw_buffers_]); | 441 std::unique_ptr<GLenum[]> buffers(new GLenum[manager_->max_draw_buffers_]); |
442 for (uint32_t i = 0; i < manager_->max_draw_buffers_; ++i) | 442 for (uint32_t i = 0; i < manager_->max_draw_buffers_; ++i) |
443 buffers[i] = GL_NONE; | 443 buffers[i] = GL_NONE; |
444 for (AttachmentMap::const_iterator it = attachments_.begin(); | 444 for (AttachmentMap::const_iterator it = attachments_.begin(); |
445 it != attachments_.end(); ++it) { | 445 it != attachments_.end(); ++it) { |
446 if (it->first >= GL_COLOR_ATTACHMENT0 && | 446 if (it->first >= GL_COLOR_ATTACHMENT0 && |
447 it->first < GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_ && | 447 it->first < GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_ && |
448 !it->second->cleared()) { | 448 !it->second->cleared()) { |
449 // There should be no partially cleared images, uncleared int/3d images. | 449 // There should be no partially cleared images, uncleared int/3d images. |
450 // This is because ClearUnclearedIntOr3DImagesOrPartiallyClearedImages() | 450 // This is because ClearUnclearedIntOr3DImagesOrPartiallyClearedImages() |
451 // is called before this. | 451 // is called before this. |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 | 841 |
842 bool FramebufferManager::IsComplete( | 842 bool FramebufferManager::IsComplete( |
843 Framebuffer* framebuffer) { | 843 Framebuffer* framebuffer) { |
844 DCHECK(framebuffer); | 844 DCHECK(framebuffer); |
845 return framebuffer->framebuffer_complete_state_count_id() == | 845 return framebuffer->framebuffer_complete_state_count_id() == |
846 framebuffer_state_change_count_; | 846 framebuffer_state_change_count_; |
847 } | 847 } |
848 | 848 |
849 } // namespace gles2 | 849 } // namespace gles2 |
850 } // namespace gpu | 850 } // namespace gpu |
OLD | NEW |