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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 DCHECK(GLES2Util::IsSignedIntegerFormat(internal_format)); | 437 DCHECK(GLES2Util::IsSignedIntegerFormat(internal_format)); |
438 const static GLint kZero[] = { 0, 0, 0, 0 }; | 438 const static GLint kZero[] = { 0, 0, 0, 0 }; |
439 glClearBufferiv(GL_COLOR, drawbuffer, kZero); | 439 glClearBufferiv(GL_COLOR, drawbuffer, kZero); |
440 } | 440 } |
441 it->second->SetCleared(renderbuffer_manager, nullptr, true); | 441 it->second->SetCleared(renderbuffer_manager, nullptr, true); |
442 } | 442 } |
443 } | 443 } |
444 } | 444 } |
445 | 445 |
446 bool Framebuffer::PrepareDrawBuffersForClear() const { | 446 bool Framebuffer::PrepareDrawBuffersForClear() const { |
447 scoped_ptr<GLenum[]> buffers(new GLenum[manager_->max_draw_buffers_]); | 447 std::unique_ptr<GLenum[]> buffers(new GLenum[manager_->max_draw_buffers_]); |
448 for (uint32_t i = 0; i < manager_->max_draw_buffers_; ++i) | 448 for (uint32_t i = 0; i < manager_->max_draw_buffers_; ++i) |
449 buffers[i] = GL_NONE; | 449 buffers[i] = GL_NONE; |
450 for (AttachmentMap::const_iterator it = attachments_.begin(); | 450 for (AttachmentMap::const_iterator it = attachments_.begin(); |
451 it != attachments_.end(); ++it) { | 451 it != attachments_.end(); ++it) { |
452 if (it->first >= GL_COLOR_ATTACHMENT0 && | 452 if (it->first >= GL_COLOR_ATTACHMENT0 && |
453 it->first < GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_ && | 453 it->first < GL_COLOR_ATTACHMENT0 + manager_->max_draw_buffers_ && |
454 !it->second->cleared()) { | 454 !it->second->cleared()) { |
455 // There should be no partially cleared images, uncleared int/3d images. | 455 // There should be no partially cleared images, uncleared int/3d images. |
456 // This is because ClearUnclearedIntOr3DImagesOrPartiallyClearedImages() | 456 // This is because ClearUnclearedIntOr3DImagesOrPartiallyClearedImages() |
457 // is called before this. | 457 // is called before this. |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 | 851 |
852 bool FramebufferManager::IsComplete( | 852 bool FramebufferManager::IsComplete( |
853 Framebuffer* framebuffer) { | 853 Framebuffer* framebuffer) { |
854 DCHECK(framebuffer); | 854 DCHECK(framebuffer); |
855 return framebuffer->framebuffer_complete_state_count_id() == | 855 return framebuffer->framebuffer_complete_state_count_id() == |
856 framebuffer_state_change_count_; | 856 framebuffer_state_change_count_; |
857 } | 857 } |
858 | 858 |
859 } // namespace gles2 | 859 } // namespace gles2 |
860 } // namespace gpu | 860 } // namespace gpu |
OLD | NEW |