| 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 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1405 int WebGLRenderingContextBase::drawingBufferWidth() const | 1405 int WebGLRenderingContextBase::drawingBufferWidth() const |
| 1406 { | 1406 { |
| 1407 return isContextLost() ? 0 : drawingBuffer()->size().width(); | 1407 return isContextLost() ? 0 : drawingBuffer()->size().width(); |
| 1408 } | 1408 } |
| 1409 | 1409 |
| 1410 int WebGLRenderingContextBase::drawingBufferHeight() const | 1410 int WebGLRenderingContextBase::drawingBufferHeight() const |
| 1411 { | 1411 { |
| 1412 return isContextLost() ? 0 : drawingBuffer()->size().height(); | 1412 return isContextLost() ? 0 : drawingBuffer()->size().height(); |
| 1413 } | 1413 } |
| 1414 | 1414 |
| 1415 unsigned WebGLRenderingContextBase::sizeInBytes(GLenum type) | 1415 unsigned WebGLRenderingContextBase::sizeInBytes(GLenum type) const |
| 1416 { | 1416 { |
| 1417 switch (type) { | 1417 switch (type) { |
| 1418 case GL_BYTE: | 1418 case GL_BYTE: |
| 1419 return sizeof(GLbyte); | 1419 return sizeof(GLbyte); |
| 1420 case GL_UNSIGNED_BYTE: | 1420 case GL_UNSIGNED_BYTE: |
| 1421 return sizeof(GLubyte); | 1421 return sizeof(GLubyte); |
| 1422 case GL_SHORT: | 1422 case GL_SHORT: |
| 1423 return sizeof(GLshort); | 1423 return sizeof(GLshort); |
| 1424 case GL_UNSIGNED_SHORT: | 1424 case GL_UNSIGNED_SHORT: |
| 1425 return sizeof(GLushort); | 1425 return sizeof(GLushort); |
| 1426 case GL_INT: | 1426 case GL_INT: |
| 1427 return sizeof(GLint); | 1427 return sizeof(GLint); |
| 1428 case GL_UNSIGNED_INT: | 1428 case GL_UNSIGNED_INT: |
| 1429 return sizeof(GLuint); | 1429 return sizeof(GLuint); |
| 1430 case GL_FLOAT: | 1430 case GL_FLOAT: |
| 1431 return sizeof(GLfloat); | 1431 return sizeof(GLfloat); |
| 1432 case GL_HALF_FLOAT: |
| 1433 return sizeof(GLushort); |
| 1434 case GL_INT_2_10_10_10_REV: |
| 1435 return sizeof(GLint); |
| 1436 case GL_UNSIGNED_INT_2_10_10_10_REV: |
| 1437 return sizeof(GLuint); |
| 1432 } | 1438 } |
| 1433 ASSERT_NOT_REACHED(); | 1439 ASSERT_NOT_REACHED(); |
| 1434 return 0; | 1440 return 0; |
| 1435 } | 1441 } |
| 1436 | 1442 |
| 1437 void WebGLRenderingContextBase::activeTexture(GLenum texture) | 1443 void WebGLRenderingContextBase::activeTexture(GLenum texture) |
| 1438 { | 1444 { |
| 1439 if (isContextLost()) | 1445 if (isContextLost()) |
| 1440 return; | 1446 return; |
| 1441 if (texture - GL_TEXTURE0 >= m_textureUnits.size()) { | 1447 if (texture - GL_TEXTURE0 >= m_textureUnits.size()) { |
| (...skipping 5619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7061 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); | 7067 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 7062 } | 7068 } |
| 7063 | 7069 |
| 7064 void WebGLRenderingContextBase::restoreUnpackParameters() | 7070 void WebGLRenderingContextBase::restoreUnpackParameters() |
| 7065 { | 7071 { |
| 7066 if (m_unpackAlignment != 1) | 7072 if (m_unpackAlignment != 1) |
| 7067 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 7073 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
| 7068 } | 7074 } |
| 7069 | 7075 |
| 7070 } // namespace blink | 7076 } // namespace blink |
| OLD | NEW |