| 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 Extensions3D* extensions = m_context->graphicsContext3D()->extensions(); | 87 Extensions3D* extensions = m_context->graphicsContext3D()->extensions(); |
| 88 return extensions->isVertexArrayOES(arrayObject->object()); | 88 return extensions->isVertexArrayOES(arrayObject->object()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void OESVertexArrayObject::bindVertexArrayOES(WebGLVertexArrayObjectOES* arrayOb
ject) | 91 void OESVertexArrayObject::bindVertexArrayOES(WebGLVertexArrayObjectOES* arrayOb
ject) |
| 92 { | 92 { |
| 93 if (isLost()) | 93 if (isLost()) |
| 94 return; | 94 return; |
| 95 | 95 |
| 96 if (arrayObject && (arrayObject->isDeleted() || !arrayObject->validate(0, co
ntext()))) { | 96 if (arrayObject && (arrayObject->isDeleted() || !arrayObject->validate(0, co
ntext()))) { |
| 97 m_context->graphicsContext3D()->synthesizeGLError(GraphicsContext3D::INV
ALID_OPERATION); | 97 m_context->graphicsContext3D()->synthesizeGLError(GL_INVALID_OPERATION); |
| 98 return; | 98 return; |
| 99 } | 99 } |
| 100 | 100 |
| 101 Extensions3D* extensions = m_context->graphicsContext3D()->extensions(); | 101 Extensions3D* extensions = m_context->graphicsContext3D()->extensions(); |
| 102 if (arrayObject && !arrayObject->isDefaultObject() && arrayObject->object())
{ | 102 if (arrayObject && !arrayObject->isDefaultObject() && arrayObject->object())
{ |
| 103 extensions->bindVertexArrayOES(arrayObject->object()); | 103 extensions->bindVertexArrayOES(arrayObject->object()); |
| 104 | 104 |
| 105 arrayObject->setHasEverBeenBound(); | 105 arrayObject->setHasEverBeenBound(); |
| 106 m_context->setBoundVertexArrayObject(arrayObject); | 106 m_context->setBoundVertexArrayObject(arrayObject); |
| 107 } else { | 107 } else { |
| 108 extensions->bindVertexArrayOES(0); | 108 extensions->bindVertexArrayOES(0); |
| 109 m_context->setBoundVertexArrayObject(0); | 109 m_context->setBoundVertexArrayObject(0); |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 bool OESVertexArrayObject::supported(WebGLRenderingContext* context) | 113 bool OESVertexArrayObject::supported(WebGLRenderingContext* context) |
| 114 { | 114 { |
| 115 Extensions3D* extensions = context->graphicsContext3D()->extensions(); | 115 Extensions3D* extensions = context->graphicsContext3D()->extensions(); |
| 116 return extensions->supports("GL_OES_vertex_array_object"); | 116 return extensions->supports("GL_OES_vertex_array_object"); |
| 117 } | 117 } |
| 118 | 118 |
| 119 const char* OESVertexArrayObject::extensionName() | 119 const char* OESVertexArrayObject::extensionName() |
| 120 { | 120 { |
| 121 return "OES_vertex_array_object"; | 121 return "OES_vertex_array_object"; |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace WebCore | 124 } // namespace WebCore |
| OLD | NEW |