| 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 4246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4257 // TODO(crbug.com/622958): Implement GPU-to-GPU path for WebGL 2 and more in
ternal formats. | 4257 // TODO(crbug.com/622958): Implement GPU-to-GPU path for WebGL 2 and more in
ternal formats. |
| 4258 if (functionID == TexSubImage2D && (isWebGL2OrHigher() || extensionEnabled(O
ESTextureFloatName) || extensionEnabled(OESTextureHalfFloatName) || extensionEna
bled(EXTsRGBName))) | 4258 if (functionID == TexSubImage2D && (isWebGL2OrHigher() || extensionEnabled(O
ESTextureFloatName) || extensionEnabled(OESTextureHalfFloatName) || extensionEna
bled(EXTsRGBName))) |
| 4259 return false; | 4259 return false; |
| 4260 return true; | 4260 return true; |
| 4261 } | 4261 } |
| 4262 | 4262 |
| 4263 void WebGLRenderingContextBase::texImageCanvasByGPU(HTMLCanvasElement* canvas, G
Luint targetTexture, GLenum targetInternalformat, GLenum targetType, GLint targe
tLevel) | 4263 void WebGLRenderingContextBase::texImageCanvasByGPU(HTMLCanvasElement* canvas, G
Luint targetTexture, GLenum targetInternalformat, GLenum targetType, GLint targe
tLevel) |
| 4264 { | 4264 { |
| 4265 if (!canvas->is3D()) { | 4265 if (!canvas->is3D()) { |
| 4266 ImageBuffer* buffer = canvas->buffer(); | 4266 ImageBuffer* buffer = canvas->buffer(); |
| 4267 if (!buffer->copyToPlatformTexture(contextGL(), targetTexture, targetInt
ernalformat, targetType, | 4267 if (buffer && !buffer->copyToPlatformTexture(contextGL(), targetTexture,
targetInternalformat, targetType, |
| 4268 targetLevel, m_unpackPremultiplyAlpha, m_unpackFlipY)) { | 4268 targetLevel, m_unpackPremultiplyAlpha, m_unpackFlipY)) { |
| 4269 NOTREACHED(); | 4269 NOTREACHED(); |
| 4270 } | 4270 } |
| 4271 } else { | 4271 } else { |
| 4272 WebGLRenderingContextBase* gl = toWebGLRenderingContextBase(canvas->rend
eringContext()); | 4272 WebGLRenderingContextBase* gl = toWebGLRenderingContextBase(canvas->rend
eringContext()); |
| 4273 ScopedTexture2DRestorer restorer(gl); | 4273 ScopedTexture2DRestorer restorer(gl); |
| 4274 if (!gl->drawingBuffer()->copyToPlatformTexture(contextGL(), targetTextu
re, targetInternalformat, targetType, | 4274 if (!gl->drawingBuffer()->copyToPlatformTexture(contextGL(), targetTextu
re, targetInternalformat, targetType, |
| 4275 targetLevel, m_unpackPremultiplyAlpha, !m_unpackFlipY, BackBuffer))
{ | 4275 targetLevel, m_unpackPremultiplyAlpha, !m_unpackFlipY, BackBuffer))
{ |
| 4276 NOTREACHED(); | 4276 NOTREACHED(); |
| 4277 } | 4277 } |
| (...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6454 | 6454 |
| 6455 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(HTMLCanvasElementOrOffs
creenCanvas& result) const | 6455 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(HTMLCanvasElementOrOffs
creenCanvas& result) const |
| 6456 { | 6456 { |
| 6457 if (canvas()) | 6457 if (canvas()) |
| 6458 result.setHTMLCanvasElement(canvas()); | 6458 result.setHTMLCanvasElement(canvas()); |
| 6459 else | 6459 else |
| 6460 result.setOffscreenCanvas(getOffscreenCanvas()); | 6460 result.setOffscreenCanvas(getOffscreenCanvas()); |
| 6461 } | 6461 } |
| 6462 | 6462 |
| 6463 } // namespace blink | 6463 } // namespace blink |
| OLD | NEW |