Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2738573002: Streamline the presentation of ImageBitmapRenderingContext (Closed)
Patch Set: Fix crash in gpu test Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 2668 matching lines...) Expand 10 before | Expand all | Expand 10 after
7845 7844
7846 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7845 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7847 HTMLCanvasElementOrOffscreenCanvas& result) const { 7846 HTMLCanvasElementOrOffscreenCanvas& result) const {
7848 if (canvas()) 7847 if (canvas())
7849 result.setHTMLCanvasElement(canvas()); 7848 result.setHTMLCanvasElement(canvas());
7850 else 7849 else
7851 result.setOffscreenCanvas(offscreenCanvas()); 7850 result.setOffscreenCanvas(offscreenCanvas());
7852 } 7851 }
7853 7852
7854 } // namespace blink 7853 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698