| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file is here so other GLES2 related files can have a common set of | 5 // This file is here so other GLES2 related files can have a common set of |
| 6 // includes where appropriate. | 6 // includes where appropriate. |
| 7 | 7 |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 case GL_RGB: | 339 case GL_RGB: |
| 340 return 3; | 340 return 3; |
| 341 case GL_LUMINANCE_ALPHA: | 341 case GL_LUMINANCE_ALPHA: |
| 342 return 2; | 342 return 2; |
| 343 case GL_RGBA: | 343 case GL_RGBA: |
| 344 case GL_BGRA_EXT: | 344 case GL_BGRA_EXT: |
| 345 return 4; | 345 return 4; |
| 346 case GL_ALPHA: | 346 case GL_ALPHA: |
| 347 case GL_LUMINANCE: | 347 case GL_LUMINANCE: |
| 348 case GL_DEPTH_COMPONENT: | 348 case GL_DEPTH_COMPONENT: |
| 349 case GL_DEPTH_COMPONENT24_OES: |
| 350 case GL_DEPTH_COMPONENT32_OES: |
| 351 case GL_DEPTH_COMPONENT16: |
| 352 case GL_DEPTH24_STENCIL8_OES: |
| 349 case GL_DEPTH_STENCIL_OES: | 353 case GL_DEPTH_STENCIL_OES: |
| 350 return 1; | 354 return 1; |
| 351 default: | 355 default: |
| 352 return 0; | 356 return 0; |
| 353 } | 357 } |
| 354 } | 358 } |
| 355 | 359 |
| 356 // Return the number of bytes per element, based on the element type. | 360 // Return the number of bytes per element, based on the element type. |
| 357 int BytesPerElement(int type) { | 361 int BytesPerElement(int type) { |
| 358 switch (type) { | 362 switch (type) { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 return kRGB; | 595 return kRGB; |
| 592 case GL_BGRA_EXT: | 596 case GL_BGRA_EXT: |
| 593 case GL_BGRA8_EXT: | 597 case GL_BGRA8_EXT: |
| 594 case GL_RGBA16F_EXT: | 598 case GL_RGBA16F_EXT: |
| 595 case GL_RGBA32F_EXT: | 599 case GL_RGBA32F_EXT: |
| 596 case GL_RGBA: | 600 case GL_RGBA: |
| 597 case GL_RGBA8_OES: | 601 case GL_RGBA8_OES: |
| 598 case GL_RGBA4: | 602 case GL_RGBA4: |
| 599 case GL_RGB5_A1: | 603 case GL_RGB5_A1: |
| 600 return kRGBA; | 604 return kRGBA; |
| 605 case GL_DEPTH_COMPONENT32_OES: |
| 606 case GL_DEPTH_COMPONENT24_OES: |
| 601 case GL_DEPTH_COMPONENT16: | 607 case GL_DEPTH_COMPONENT16: |
| 602 case GL_DEPTH_COMPONENT: | 608 case GL_DEPTH_COMPONENT: |
| 603 return kDepth; | 609 return kDepth; |
| 604 case GL_STENCIL_INDEX8: | 610 case GL_STENCIL_INDEX8: |
| 605 return kStencil; | 611 return kStencil; |
| 606 case GL_DEPTH_STENCIL_OES: | 612 case GL_DEPTH_STENCIL_OES: |
| 607 case GL_DEPTH24_STENCIL8_OES: | 613 case GL_DEPTH24_STENCIL8_OES: |
| 608 return kDepth | kStencil; | 614 return kDepth | kStencil; |
| 609 default: | 615 default: |
| 610 return 0x0000; | 616 return 0x0000; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 } | 754 } |
| 749 | 755 |
| 750 return true; | 756 return true; |
| 751 } | 757 } |
| 752 | 758 |
| 753 #include "../common/gles2_cmd_utils_implementation_autogen.h" | 759 #include "../common/gles2_cmd_utils_implementation_autogen.h" |
| 754 | 760 |
| 755 } // namespace gles2 | 761 } // namespace gles2 |
| 756 } // namespace gpu | 762 } // namespace gpu |
| 757 | 763 |
| OLD | NEW |