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

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

Issue 2503283007: Work around unknown Mac Intel driver bug causing non-deterministic behavior in GPU readback from 2D (Closed)
Patch Set: address comments Created 4 years, 1 month 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 5040 matching lines...) Expand 10 before | Expand all | Expand 10 after
5051 } else { 5051 } else {
5052 DCHECK_EQ(depth, 1); 5052 DCHECK_EQ(depth, 1);
5053 DCHECK_EQ(unpackImageHeight, 0); 5053 DCHECK_EQ(unpackImageHeight, 0);
5054 } 5054 }
5055 5055
5056 if (functionID == TexImage2D || functionID == TexSubImage2D) { 5056 if (functionID == TexImage2D || functionID == TexSubImage2D) {
5057 // texImageByGPU relies on copyTextureCHROMIUM which doesn't support 5057 // texImageByGPU relies on copyTextureCHROMIUM which doesn't support
5058 // float/integer/sRGB internal format. 5058 // float/integer/sRGB internal format.
5059 // TODO(crbug.com/622958): relax the constrains if copyTextureCHROMIUM is 5059 // TODO(crbug.com/622958): relax the constrains if copyTextureCHROMIUM is
5060 // upgraded to handle more formats. 5060 // upgraded to handle more formats.
5061 if (!canvas->renderingContext() || 5061 bool forceSoftwareReadbackFrom2DCanvas =
5062 !canvas->renderingContext()->isAccelerated() || 5062 this->canvas() && this->canvas()->document().settings() &&
5063 !canUseTexImageByGPU(functionID, internalformat, type)) { 5063 this->canvas()
5064 ->document()
5065 .settings()
5066 ->forceSoftwareReadbackFrom2DCanvas();
5067 CanvasRenderingContext* sourceContext = canvas->renderingContext();
5068 if (!sourceContext || !sourceContext->isAccelerated() ||
5069 !canUseTexImageByGPU(functionID, internalformat, type) ||
5070 (forceSoftwareReadbackFrom2DCanvas && sourceContext->is2d())) {
5064 // 2D canvas has only FrontBuffer. 5071 // 2D canvas has only FrontBuffer.
5065 texImageImpl(functionID, target, level, internalformat, xoffset, yoffset, 5072 texImageImpl(functionID, target, level, internalformat, xoffset, yoffset,
5066 zoffset, format, type, 5073 zoffset, format, type,
5067 canvas->copiedImage(FrontBuffer, PreferAcceleration).get(), 5074 canvas->copiedImage(FrontBuffer, PreferAcceleration).get(),
5068 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, 5075 WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY,
5069 m_unpackPremultiplyAlpha, sourceSubRectangle, 1, 0); 5076 m_unpackPremultiplyAlpha, sourceSubRectangle, 1, 0);
5070 return; 5077 return;
5071 } 5078 }
5072 5079
5073 // The GPU-GPU copy path uses the Y-up coordinate system. 5080 // The GPU-GPU copy path uses the Y-up coordinate system.
(...skipping 2715 matching lines...) Expand 10 before | Expand all | Expand 10 after
7789 7796
7790 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7797 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7791 HTMLCanvasElementOrOffscreenCanvas& result) const { 7798 HTMLCanvasElementOrOffscreenCanvas& result) const {
7792 if (canvas()) 7799 if (canvas())
7793 result.setHTMLCanvasElement(canvas()); 7800 result.setHTMLCanvasElement(canvas());
7794 else 7801 else
7795 result.setOffscreenCanvas(getOffscreenCanvas()); 7802 result.setOffscreenCanvas(getOffscreenCanvas());
7796 } 7803 }
7797 7804
7798 } // namespace blink 7805 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Settings.in ('k') | third_party/WebKit/Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698