| OLD | NEW |
| 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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 | 989 |
| 990 contextGL()->Viewport(0, 0, drawingBufferWidth(), drawingBufferHeight()); | 990 contextGL()->Viewport(0, 0, drawingBufferWidth(), drawingBufferHeight()); |
| 991 contextGL()->Scissor(0, 0, drawingBufferWidth(), drawingBufferHeight()); | 991 contextGL()->Scissor(0, 0, drawingBufferWidth(), drawingBufferHeight()); |
| 992 | 992 |
| 993 m_contextLostCallbackAdapter = WebGLRenderingContextLostCallback::create(thi
s); | 993 m_contextLostCallbackAdapter = WebGLRenderingContextLostCallback::create(thi
s); |
| 994 m_errorMessageCallbackAdapter = WebGLRenderingContextErrorMessageCallback::c
reate(this); | 994 m_errorMessageCallbackAdapter = WebGLRenderingContextErrorMessageCallback::c
reate(this); |
| 995 | 995 |
| 996 webContext()->setContextLostCallback(m_contextLostCallbackAdapter.get()); | 996 webContext()->setContextLostCallback(m_contextLostCallbackAdapter.get()); |
| 997 webContext()->setErrorMessageCallback(m_errorMessageCallbackAdapter.get()); | 997 webContext()->setErrorMessageCallback(m_errorMessageCallbackAdapter.get()); |
| 998 | 998 |
| 999 // If WebGL 2, the PRIMITIVE_RESTART_FIXED_INDEX should be always enabled. | |
| 1000 // See the section <Primitive Restart is Always Enabled> in WebGL 2 spec: | |
| 1001 // https://www.khronos.org/registry/webgl/specs/latest/2.0/#4.1.4 | |
| 1002 if (isWebGL2OrHigher()) | |
| 1003 contextGL()->Enable(GL_PRIMITIVE_RESTART_FIXED_INDEX); | |
| 1004 | |
| 1005 // This ensures that the context has a valid "lastFlushID" and won't be mist
akenly identified as the "least recently used" context. | 999 // This ensures that the context has a valid "lastFlushID" and won't be mist
akenly identified as the "least recently used" context. |
| 1006 contextGL()->Flush(); | 1000 contextGL()->Flush(); |
| 1007 | 1001 |
| 1008 for (int i = 0; i < WebGLExtensionNameCount; ++i) | 1002 for (int i = 0; i < WebGLExtensionNameCount; ++i) |
| 1009 m_extensionEnabled[i] = false; | 1003 m_extensionEnabled[i] = false; |
| 1010 | 1004 |
| 1011 m_isWebGL2FormatsTypesAdded = false; | 1005 m_isWebGL2FormatsTypesAdded = false; |
| 1012 m_isWebGL2InternalFormatsCopyTexImageAdded = false; | 1006 m_isWebGL2InternalFormatsCopyTexImageAdded = false; |
| 1013 m_isOESTextureFloatFormatsTypesAdded = false; | 1007 m_isOESTextureFloatFormatsTypesAdded = false; |
| 1014 m_isOESTextureHalfFloatFormatsTypesAdded = false; | 1008 m_isOESTextureHalfFloatFormatsTypesAdded = false; |
| (...skipping 5287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6302 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6296 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 6303 } | 6297 } |
| 6304 | 6298 |
| 6305 void WebGLRenderingContextBase::restoreUnpackParameters() | 6299 void WebGLRenderingContextBase::restoreUnpackParameters() |
| 6306 { | 6300 { |
| 6307 if (m_unpackAlignment != 1) | 6301 if (m_unpackAlignment != 1) |
| 6308 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6302 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
| 6309 } | 6303 } |
| 6310 | 6304 |
| 6311 } // namespace blink | 6305 } // namespace blink |
| OLD | NEW |