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 5134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5145 funcName, functionID, canvas, sourceSubRectangle, depth, | 5145 funcName, functionID, canvas, sourceSubRectangle, depth, |
5146 unpackImageHeight, &selectingSubRectangle)) { | 5146 unpackImageHeight, &selectingSubRectangle)) { |
5147 return; | 5147 return; |
5148 } | 5148 } |
5149 | 5149 |
5150 if (functionID == TexImage2D || functionID == TexSubImage2D) { | 5150 if (functionID == TexImage2D || functionID == TexSubImage2D) { |
5151 // texImageByGPU relies on copyTextureCHROMIUM which doesn't support | 5151 // texImageByGPU relies on copyTextureCHROMIUM which doesn't support |
5152 // float/integer/sRGB internal format. | 5152 // float/integer/sRGB internal format. |
5153 // TODO(crbug.com/622958): relax the constrains if copyTextureCHROMIUM is | 5153 // TODO(crbug.com/622958): relax the constrains if copyTextureCHROMIUM is |
5154 // upgraded to handle more formats. | 5154 // upgraded to handle more formats. |
5155 if (!canvas->renderingContext() || | 5155 if (!canvas->isAccelerated() || |
5156 !canvas->renderingContext()->isAccelerated() || | |
5157 !canUseTexImageByGPU(functionID, internalformat, type)) { | 5156 !canUseTexImageByGPU(functionID, internalformat, type)) { |
5158 // 2D canvas has only FrontBuffer. | 5157 // 2D canvas has only FrontBuffer. |
5159 texImageImpl(functionID, target, level, internalformat, xoffset, yoffset, | 5158 texImageImpl(functionID, target, level, internalformat, xoffset, yoffset, |
5160 zoffset, format, type, | 5159 zoffset, format, type, |
5161 canvas | 5160 canvas |
5162 ->copiedImage(FrontBuffer, PreferAcceleration, | 5161 ->copiedImage(FrontBuffer, PreferAcceleration, |
5163 functionIDToSnapshotReason(functionID)) | 5162 functionIDToSnapshotReason(functionID)) |
5164 .get(), | 5163 .get(), |
5165 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, | 5164 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, |
5166 m_unpackPremultiplyAlpha, sourceSubRectangle, 1, 0); | 5165 m_unpackPremultiplyAlpha, sourceSubRectangle, 1, 0); |
(...skipping 2671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7838 | 7837 |
7839 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( | 7838 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( |
7840 HTMLCanvasElementOrOffscreenCanvas& result) const { | 7839 HTMLCanvasElementOrOffscreenCanvas& result) const { |
7841 if (canvas()) | 7840 if (canvas()) |
7842 result.setHTMLCanvasElement(canvas()); | 7841 result.setHTMLCanvasElement(canvas()); |
7843 else | 7842 else |
7844 result.setOffscreenCanvas(offscreenCanvas()); | 7843 result.setOffscreenCanvas(offscreenCanvas()); |
7845 } | 7844 } |
7846 | 7845 |
7847 } // namespace blink | 7846 } // namespace blink |
OLD | NEW |