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

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

Issue 1859703002: convert //gpu to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 4 years, 8 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
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 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
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/framebuffer_manager.h ('k') | gpu/command_buffer/service/framebuffer_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698