| 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 5144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5155 funcName, functionID, canvas, sourceSubRectangle, depth, | 5155 funcName, functionID, canvas, sourceSubRectangle, depth, |
| 5156 unpackImageHeight, &selectingSubRectangle)) { | 5156 unpackImageHeight, &selectingSubRectangle)) { |
| 5157 return; | 5157 return; |
| 5158 } | 5158 } |
| 5159 | 5159 |
| 5160 if (functionID == TexImage2D || functionID == TexSubImage2D) { | 5160 if (functionID == TexImage2D || functionID == TexSubImage2D) { |
| 5161 // texImageByGPU relies on copyTextureCHROMIUM which doesn't support | 5161 // texImageByGPU relies on copyTextureCHROMIUM which doesn't support |
| 5162 // float/integer/sRGB internal format. | 5162 // float/integer/sRGB internal format. |
| 5163 // TODO(crbug.com/622958): relax the constrains if copyTextureCHROMIUM is | 5163 // TODO(crbug.com/622958): relax the constrains if copyTextureCHROMIUM is |
| 5164 // upgraded to handle more formats. | 5164 // upgraded to handle more formats. |
| 5165 if (!canvas->renderingContext() || | 5165 if (!canvas->isAccelerated() || |
| 5166 !canvas->renderingContext()->isAccelerated() || | |
| 5167 !canUseTexImageByGPU(functionID, internalformat, type)) { | 5166 !canUseTexImageByGPU(functionID, internalformat, type)) { |
| 5168 // 2D canvas has only FrontBuffer. | 5167 // 2D canvas has only FrontBuffer. |
| 5169 texImageImpl(functionID, target, level, internalformat, xoffset, yoffset, | 5168 texImageImpl(functionID, target, level, internalformat, xoffset, yoffset, |
| 5170 zoffset, format, type, | 5169 zoffset, format, type, |
| 5171 canvas | 5170 canvas |
| 5172 ->copiedImage(FrontBuffer, PreferAcceleration, | 5171 ->copiedImage(FrontBuffer, PreferAcceleration, |
| 5173 functionIDToSnapshotReason(functionID)) | 5172 functionIDToSnapshotReason(functionID)) |
| 5174 .get(), | 5173 .get(), |
| 5175 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, | 5174 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, |
| 5176 m_unpackPremultiplyAlpha, sourceSubRectangle, 1, 0); | 5175 m_unpackPremultiplyAlpha, sourceSubRectangle, 1, 0); |
| (...skipping 2673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7850 | 7849 |
| 7851 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( | 7850 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( |
| 7852 HTMLCanvasElementOrOffscreenCanvas& result) const { | 7851 HTMLCanvasElementOrOffscreenCanvas& result) const { |
| 7853 if (canvas()) | 7852 if (canvas()) |
| 7854 result.setHTMLCanvasElement(canvas()); | 7853 result.setHTMLCanvasElement(canvas()); |
| 7855 else | 7854 else |
| 7856 result.setOffscreenCanvas(offscreenCanvas()); | 7855 result.setOffscreenCanvas(offscreenCanvas()); |
| 7857 } | 7856 } |
| 7858 | 7857 |
| 7859 } // namespace blink | 7858 } // namespace blink |
| OLD | NEW |