| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/webgl/WebGL2RenderingContextBase.h" | 6 #include "modules/webgl/WebGL2RenderingContextBase.h" |
| 7 | 7 |
| 8 #include "bindings/modules/v8/WebGLAny.h" | 8 #include "bindings/modules/v8/WebGLAny.h" |
| 9 #include "core/html/HTMLCanvasElement.h" | 9 #include "core/html/HTMLCanvasElement.h" |
| 10 #include "core/html/HTMLImageElement.h" | 10 #include "core/html/HTMLImageElement.h" |
| (...skipping 2097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2108 default: | 2108 default: |
| 2109 synthesizeGLError(GL_INVALID_ENUM, "readPixels", "invalid format"); | 2109 synthesizeGLError(GL_INVALID_ENUM, "readPixels", "invalid format"); |
| 2110 return false; | 2110 return false; |
| 2111 } | 2111 } |
| 2112 | 2112 |
| 2113 switch (type) { | 2113 switch (type) { |
| 2114 case GL_UNSIGNED_BYTE: | 2114 case GL_UNSIGNED_BYTE: |
| 2115 case GL_BYTE: | 2115 case GL_BYTE: |
| 2116 case GL_HALF_FLOAT: | 2116 case GL_HALF_FLOAT: |
| 2117 case GL_FLOAT: | 2117 case GL_FLOAT: |
| 2118 case GL_UNSIGNED_SHORT: |
| 2118 case GL_UNSIGNED_SHORT_5_6_5: | 2119 case GL_UNSIGNED_SHORT_5_6_5: |
| 2119 case GL_UNSIGNED_SHORT_4_4_4_4: | 2120 case GL_UNSIGNED_SHORT_4_4_4_4: |
| 2120 case GL_UNSIGNED_SHORT_5_5_5_1: | 2121 case GL_UNSIGNED_SHORT_5_5_5_1: |
| 2122 case GL_SHORT: |
| 2121 case GL_UNSIGNED_INT: | 2123 case GL_UNSIGNED_INT: |
| 2122 case GL_UNSIGNED_INT_2_10_10_10_REV: | 2124 case GL_UNSIGNED_INT_2_10_10_10_REV: |
| 2123 case GL_UNSIGNED_INT_10F_11F_11F_REV: | 2125 case GL_UNSIGNED_INT_10F_11F_11F_REV: |
| 2124 case GL_UNSIGNED_INT_5_9_9_9_REV: | 2126 case GL_UNSIGNED_INT_5_9_9_9_REV: |
| 2125 case GL_INT: | 2127 case GL_INT: |
| 2126 break; | 2128 break; |
| 2127 default: | 2129 default: |
| 2128 synthesizeGLError(GL_INVALID_ENUM, "readPixels", "invalid type"); | 2130 synthesizeGLError(GL_INVALID_ENUM, "readPixels", "invalid type"); |
| 2129 return false; | 2131 return false; |
| 2130 } | 2132 } |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2418 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() | 2420 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() |
| 2419 { | 2421 { |
| 2420 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) | 2422 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) |
| 2421 return m_readFramebufferBinding->colorBufferFormat(); | 2423 return m_readFramebufferBinding->colorBufferFormat(); |
| 2422 if (m_requestedAttributes.alpha()) | 2424 if (m_requestedAttributes.alpha()) |
| 2423 return GL_RGBA; | 2425 return GL_RGBA; |
| 2424 return GL_RGB; | 2426 return GL_RGB; |
| 2425 } | 2427 } |
| 2426 | 2428 |
| 2427 } // namespace blink | 2429 } // namespace blink |
| OLD | NEW |