Chromium Code Reviews| 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 4127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4138 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. | 4138 // The UNSIGNED_INT_10F_11F_11F_REV type pack/unpack isn't implemented. |
| 4139 type = GL_FLOAT; | 4139 type = GL_FLOAT; |
| 4140 } | 4140 } |
| 4141 texImage2DImpl(target, level, internalformat, format, type, imageForRender.g et(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlph a); | 4141 texImage2DImpl(target, level, internalformat, format, type, imageForRender.g et(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlph a); |
| 4142 } | 4142 } |
| 4143 | 4143 |
| 4144 bool WebGLRenderingContextBase::canUseTexImageCanvasByGPU(GLint internalformat, GLenum type) | 4144 bool WebGLRenderingContextBase::canUseTexImageCanvasByGPU(GLint internalformat, GLenum type) |
| 4145 { | 4145 { |
| 4146 if (isFloatType(type) || isIntegerFormat(internalformat) || isSRGBFormat(int ernalformat)) | 4146 if (isFloatType(type) || isIntegerFormat(internalformat) || isSRGBFormat(int ernalformat)) |
| 4147 return false; | 4147 return false; |
| 4148 switch (internalformat) { | |
| 4149 case GL_RGB565: | |
| 4150 case GL_RGBA4: | |
| 4151 case GL_RGB5_A1: | |
|
Zhenyao Mo
2016/06/06 12:47:47
I think these are the only packed formats that goe
Corentin Wallez
2016/06/06 15:25:46
What is the alternative path?
Zhenyao Mo
2016/06/06 16:09:20
We pack them into target format in software and th
| |
| 4152 // FIXME: ES3 limitation that CopyTexImage with sized internalformat, | |
| 4153 // component sizes have to match the source color format. | |
|
Ken Russell (switch to Gerrit)
2016/06/06 23:23:48
Do you think it would be worth making canUseTexIma
Zhenyao Mo
2016/06/07 00:36:50
Done. RGB565 is only not renderable on Mac NVidia
| |
| 4154 return false; | |
| 4155 default: | |
| 4156 break; | |
| 4157 } | |
| 4148 return true; | 4158 return true; |
| 4149 } | 4159 } |
| 4150 | 4160 |
| 4151 void WebGLRenderingContextBase::texImageCanvasByGPU(TexImageByGPUType functionTy pe, WebGLTexture* texture, GLenum target, | 4161 void WebGLRenderingContextBase::texImageCanvasByGPU(TexImageByGPUType functionTy pe, WebGLTexture* texture, GLenum target, |
| 4152 GLint level, GLint internalformat, GLenum type, GLint xoffset, GLint yoffset , GLint zoffset, HTMLCanvasElement* canvas) | 4162 GLint level, GLint internalformat, GLenum type, GLint xoffset, GLint yoffset , GLint zoffset, HTMLCanvasElement* canvas) |
| 4153 { | 4163 { |
| 4154 ScopedTexture2DRestorer restorer(this); | 4164 ScopedTexture2DRestorer restorer(this); |
| 4155 | 4165 |
| 4156 GLuint targetTexture = texture->object(); | 4166 GLuint targetTexture = texture->object(); |
| 4157 GLenum targetType = type; | 4167 GLenum targetType = type; |
| (...skipping 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6424 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6434 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 6425 } | 6435 } |
| 6426 | 6436 |
| 6427 void WebGLRenderingContextBase::restoreUnpackParameters() | 6437 void WebGLRenderingContextBase::restoreUnpackParameters() |
| 6428 { | 6438 { |
| 6429 if (m_unpackAlignment != 1) | 6439 if (m_unpackAlignment != 1) |
| 6430 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6440 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
| 6431 } | 6441 } |
| 6432 | 6442 |
| 6433 } // namespace blink | 6443 } // namespace blink |
| OLD | NEW |