| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 return scoped.context()->contextGL()->IsVertexArrayOES(arrayObject->object()
); | 87 return scoped.context()->contextGL()->IsVertexArrayOES(arrayObject->object()
); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void OESVertexArrayObject::bindVertexArrayOES(ScriptState* scriptState, WebGLVer
texArrayObjectOES* arrayObject) | 90 void OESVertexArrayObject::bindVertexArrayOES(ScriptState* scriptState, WebGLVer
texArrayObjectOES* arrayObject) |
| 91 { | 91 { |
| 92 WebGLExtensionScopedContext scoped(this); | 92 WebGLExtensionScopedContext scoped(this); |
| 93 if (scoped.isLost()) | 93 if (scoped.isLost()) |
| 94 return; | 94 return; |
| 95 | 95 |
| 96 if (arrayObject && (arrayObject->isDeleted() || !arrayObject->validate(0, sc
oped.context()))) { | 96 if (arrayObject && (arrayObject->isDeleted() || !arrayObject->validate(0, sc
oped.context()))) { |
| 97 scoped.context()->webContext()->synthesizeGLError(GL_INVALID_OPERATION); | 97 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "bindVertexArr
ayOES", "invalid arrayObject"); |
| 98 return; | 98 return; |
| 99 } | 99 } |
| 100 | 100 |
| 101 if (arrayObject && !arrayObject->isDefaultObject() && arrayObject->object())
{ | 101 if (arrayObject && !arrayObject->isDefaultObject() && arrayObject->object())
{ |
| 102 scoped.context()->contextGL()->BindVertexArrayOES(arrayObject->object())
; | 102 scoped.context()->contextGL()->BindVertexArrayOES(arrayObject->object())
; |
| 103 | 103 |
| 104 arrayObject->setHasEverBeenBound(); | 104 arrayObject->setHasEverBeenBound(); |
| 105 scoped.context()->setBoundVertexArrayObject(scriptState, arrayObject); | 105 scoped.context()->setBoundVertexArrayObject(scriptState, arrayObject); |
| 106 } else { | 106 } else { |
| 107 scoped.context()->contextGL()->BindVertexArrayOES(0); | 107 scoped.context()->contextGL()->BindVertexArrayOES(0); |
| 108 scoped.context()->setBoundVertexArrayObject(scriptState, nullptr); | 108 scoped.context()->setBoundVertexArrayObject(scriptState, nullptr); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 bool OESVertexArrayObject::supported(WebGLRenderingContextBase* context) | 112 bool OESVertexArrayObject::supported(WebGLRenderingContextBase* context) |
| 113 { | 113 { |
| 114 return context->extensionsUtil()->supportsExtension("GL_OES_vertex_array_obj
ect"); | 114 return context->extensionsUtil()->supportsExtension("GL_OES_vertex_array_obj
ect"); |
| 115 } | 115 } |
| 116 | 116 |
| 117 const char* OESVertexArrayObject::extensionName() | 117 const char* OESVertexArrayObject::extensionName() |
| 118 { | 118 { |
| 119 return "OES_vertex_array_object"; | 119 return "OES_vertex_array_object"; |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace blink | 122 } // namespace blink |
| OLD | NEW |