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

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 meaningful names Created 6 years, 2 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 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 696bb7cf61559f4bc75e6daf127f2a69be32f552..372a95a63b8f5b738aae1039634aa7ae510a9d43 100644
--- a/Source/core/html/canvas/WebGLFramebuffer.cpp
+++ b/Source/core/html/canvas/WebGLFramebuffer.cpp
@@ -465,10 +465,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;
@@ -495,9 +495,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";
@@ -507,7 +507,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;
@@ -570,8 +570,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