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

Unified Diff: Source/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 749653002: WebGL: clarify which Front or Back buffer is used by each API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp
diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
index 151e37c8648804dee30863e729eda0cf64fff09c..2a4ccbe7acc1214b12f041e069793599009585e1 100644
--- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
@@ -915,26 +915,6 @@ void WebGLRenderingContextBase::paintRenderingResultsToCanvas(SourceBuffer sourc
drawingBuffer()->bind();
}
-PassRefPtrWillBeRawPtr<ImageData> WebGLRenderingContextBase::paintRenderingResultsToImageData()
-{
- if (isContextLost())
- return nullptr;
-
- clearIfComposited();
- drawingBuffer()->commit();
- int width, height;
- RefPtr<Uint8ClampedArray> imageDataPixels = drawingBuffer()->paintRenderingResultsToImageData(width, height);
- if (!imageDataPixels)
- return nullptr;
-
- if (m_framebufferBinding)
- webContext()->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebufferBinding.get()));
- else
- drawingBuffer()->bind();
-
- return ImageData::create(IntSize(width, height), imageDataPixels);
-}
-
void WebGLRenderingContextBase::reshape(int width, int height)
{
if (isContextLost())
@@ -3557,11 +3537,7 @@ void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in
}
}
- RefPtrWillBeRawPtr<ImageData> imageData = canvas->getImageData();
- if (imageData)
- texImage2D(target, level, internalformat, format, type, imageData.get(), exceptionState);
- else
- texImage2DImpl(target, level, internalformat, format, type, canvas->copiedImage(), WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha, exceptionState);
+ texImage2DImpl(target, level, internalformat, format, type, canvas->copiedImage(HTMLCanvasElement::Back), WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha, exceptionState);
}
PassRefPtr<Image> WebGLRenderingContextBase::videoFrameToImage(HTMLVideoElement* video, BackingStoreCopy backingStoreCopy)
@@ -3795,11 +3771,7 @@ void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
|| !validateTexFunc("texSubImage2D", TexSubImage2D, SourceHTMLCanvasElement, target, level, format, canvas->width(), canvas->height(), 0, format, type, xoffset, yoffset))
return;
- RefPtrWillBeRawPtr<ImageData> imageData = canvas->getImageData();
- if (imageData)
- texSubImage2D(target, level, xoffset, yoffset, format, type, imageData.get(), exceptionState);
- else
- texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas->copiedImage(), WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha, exceptionState);
+ texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas->copiedImage(HTMLCanvasElement::Back), WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha, exceptionState);
}
void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,

Powered by Google App Engine
This is Rietveld 408576698