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

Unified Diff: Source/core/html/canvas/WebGLFramebuffer.cpp

Issue 656723005: Use C++11 features in core/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use nullptr Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/WebGLFramebuffer.cpp
diff --git a/Source/core/html/canvas/WebGLFramebuffer.cpp b/Source/core/html/canvas/WebGLFramebuffer.cpp
index 6f1dcdc61eb1494ad37c6688dca12acd439ec871..e88f633eb5e42a1f719df0d41d649dee3576d3ba 100644
--- a/Source/core/html/canvas/WebGLFramebuffer.cpp
+++ b/Source/core/html/canvas/WebGLFramebuffer.cpp
@@ -332,9 +332,9 @@ void WebGLFramebuffer::attach(GLenum attachment, GLenum attachmentPoint)
WebGLSharedObject* WebGLFramebuffer::getAttachmentObject(GLenum attachment) const
{
if (!object())
- return 0;
+ return nullptr;
WebGLAttachment* attachmentObject = getAttachment(attachment);
- return attachmentObject ? attachmentObject->object() : 0;
+ return attachmentObject ? attachmentObject->object() : nullptr;
}
bool WebGLFramebuffer::isAttachmentComplete(WebGLAttachment* attachedObject, GLenum attachment, const char** reason) const
@@ -467,10 +467,10 @@ void WebGLFramebuffer::removeAttachmentFromBoundFramebuffer(WebGLSharedObject* a
bool checkMore = true;
while (checkMore) {
checkMore = false;
- for (AttachmentMap::iterator it = m_attachments.begin(); it != m_attachments.end(); ++it) {
- WebGLAttachment* attachmentObject = it->value.get();
+ for (const auto& it : m_attachments) {
+ WebGLAttachment* attachmentObject = it.value.get();
if (attachmentObject->isSharedObject(attachment)) {
- GLenum attachmentType = it->key;
+ GLenum attachmentType = it.key;
attachmentObject->unattach(context()->webContext(), attachmentType);
removeAttachmentFromBoundFramebuffer(attachmentType);
checkMore = true;
@@ -497,9 +497,9 @@ GLenum WebGLFramebuffer::checkStatus(const char** reason) const
bool haveDepth = false;
bool haveStencil = false;
bool haveDepthStencil = false;
- for (AttachmentMap::const_iterator it = m_attachments.begin(); it != m_attachments.end(); ++it) {
- WebGLAttachment* attachment = it->value.get();
- if (!isAttachmentComplete(attachment, it->key, reason))
+ for (const auto& it : m_attachments) {
+ WebGLAttachment* attachment = it.value.get();
+ if (!isAttachmentComplete(attachment, it.key, reason))
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
if (!attachment->valid()) {
*reason = "attachment is not valid";
@@ -509,7 +509,7 @@ GLenum WebGLFramebuffer::checkStatus(const char** reason) const
*reason = "attachment is an unsupported format";
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
- switch (it->key) {
+ switch (it.key) {
case GL_DEPTH_ATTACHMENT:
haveDepth = true;
break;
@@ -572,8 +572,8 @@ void WebGLFramebuffer::deleteObjectImpl(blink::WebGraphicsContext3D* context3d,
// The WebGLAttachment-derived classes instead handle detachment
// on their own when finalizing, so the explicit notification is
// not needed.
- for (AttachmentMap::iterator it = m_attachments.begin(); it != m_attachments.end(); ++it)
- it->value->onDetached(context3d);
+ for (const auto& attachment : m_attachments)
+ attachment.value->onDetached(context3d);
#endif
context3d->deleteFramebuffer(object);

Powered by Google App Engine
This is Rietveld 408576698