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

Unified Diff: Source/WebCore/html/canvas/WebGLRenderingContext.cpp

Issue 12667022: Merge 144241 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/canvas/WebGLRenderingContext.cpp
===================================================================
--- Source/WebCore/html/canvas/WebGLRenderingContext.cpp (revision 145452)
+++ Source/WebCore/html/canvas/WebGLRenderingContext.cpp (working copy)
@@ -3708,6 +3708,10 @@
Vector<uint8_t> data;
if (!pixels)
return;
+ if (!validateTexFuncFormatAndType("texImage2D", format, type, level))
+ return;
+ if (!validateSettableTexFormat("texImage2D", format))
+ return;
bool needConversion = true;
// The data from ImageData is always of format RGBA8.
// No conversion is needed if destination format is RGBA and type is USIGNED_BYTE and no Flip or Premultiply operation is required.
@@ -3756,6 +3760,10 @@
ec = SECURITY_ERR;
return;
}
+ if (!validateTexFuncFormatAndType("texImage2D", format, type, level))
+ return;
+ if (!validateSettableTexFormat("texImage2D", format))
+ return;
WebGLTexture* texture = validateTextureBinding("texImage2D", target, true);
// If possible, copy from the canvas element directly to the texture
@@ -3897,6 +3905,10 @@
ec = 0;
if (isContextLost())
return;
+ if (!validateTexFuncFormatAndType("texSubImage2D", format, type, level))
+ return;
+ if (!validateSettableTexFormat("texSubImage2D", format))
+ return;
Vector<uint8_t> data;
GraphicsContext3D::ImageExtractor imageExtractor(image, domSource, premultiplyAlpha, m_unpackColorspaceConversion == GraphicsContext3D::NONE);
if (!imageExtractor.extractSucceeded()) {
@@ -3958,6 +3970,10 @@
return;
if (!pixels)
return;
+ if (!validateTexFuncFormatAndType("texSubImage2D", format, type, level))
+ return;
+ if (!validateSettableTexFormat("texSubImage2D", format))
+ return;
Vector<uint8_t> data;
bool needConversion = true;
// The data from ImageData is always of format RGBA8.
@@ -4006,6 +4022,10 @@
ec = SECURITY_ERR;
return;
}
+ if (!validateTexFuncFormatAndType("texSubImage2D", format, type, level))
+ return;
+ if (!validateSettableTexFormat("texSubImage2D", format))
+ return;
RefPtr<ImageData> imageData = canvas->getImageData();
if (imageData)
texSubImage2D(target, level, xoffset, yoffset, format, type, imageData.get(), ec);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698