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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 1885303002: Verify that a WebGLFramebuffer is bound to its context only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use a release assert 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 6125 matching lines...) Expand 10 before | Expand all | Expand 10 after
6136 return m_maxColorAttachments; 6136 return m_maxColorAttachments;
6137 } 6137 }
6138 6138
6139 void WebGLRenderingContextBase::setBackDrawBuffer(GLenum buf) 6139 void WebGLRenderingContextBase::setBackDrawBuffer(GLenum buf)
6140 { 6140 {
6141 m_backDrawBuffer = buf; 6141 m_backDrawBuffer = buf;
6142 } 6142 }
6143 6143
6144 void WebGLRenderingContextBase::setFramebuffer(GLenum target, WebGLFramebuffer* buffer) 6144 void WebGLRenderingContextBase::setFramebuffer(GLenum target, WebGLFramebuffer* buffer)
6145 { 6145 {
6146 RELEASE_ASSERT(!buffer || buffer->context() == this);
6146 if (buffer) 6147 if (buffer)
6147 buffer->setHasEverBeenBound(); 6148 buffer->setHasEverBeenBound();
6148 6149
6149 if (target == GL_FRAMEBUFFER || target == GL_DRAW_FRAMEBUFFER) { 6150 if (target == GL_FRAMEBUFFER || target == GL_DRAW_FRAMEBUFFER) {
6150 m_framebufferBinding = buffer; 6151 m_framebufferBinding = buffer;
6151 applyStencilTest(); 6152 applyStencilTest();
6152 } 6153 }
6153 drawingBuffer()->setFramebufferBinding(target, objectOrZero(getFramebufferBi nding(target))); 6154 drawingBuffer()->setFramebufferBinding(target, objectOrZero(getFramebufferBi nding(target)));
6154 6155
6155 if (!buffer) { 6156 if (!buffer) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
6290 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); 6291 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1);
6291 } 6292 }
6292 6293
6293 void WebGLRenderingContextBase::restoreUnpackParameters() 6294 void WebGLRenderingContextBase::restoreUnpackParameters()
6294 { 6295 {
6295 if (m_unpackAlignment != 1) 6296 if (m_unpackAlignment != 1)
6296 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); 6297 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
6297 } 6298 }
6298 6299
6299 } // namespace blink 6300 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698