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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2082483002: Support line-continuation character in WebGL 2.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 4 years, 6 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: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index 1c7cf0f6b1bd990e571bc530520c1ecd66fd4eb4..9f8d01d1b3b05d186ef42053be7af4dafa0dd8b1 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -448,6 +448,14 @@ void StripComments::process(UChar c)
break;
case InSingleLineComment:
+ // Handle line-continuation character in single line comment.
+ // Advance string to next nonspace character and eat it.
Zhenyao Mo 2016/06/29 18:16:07 Can you also add a comment, saying that line-conti
Ken Russell (switch to Gerrit) 2016/06/30 00:04:31 This change doesn't seem to implement the behavior
qiankun 2016/06/30 15:12:47 Done.
+ if (c == '\\') {
+ while (peek(temp) && WTF::isASCIISpace(temp))
+ advance();
+ advance();
+ }
+
// The newline code at the top of this function takes care
// of resetting our state when we get out of the
// single-line comment. Swallow all other characters.
@@ -5461,6 +5469,9 @@ bool WebGLRenderingContextBase::validateSize(const char* functionName, GLint x,
bool WebGLRenderingContextBase::validateString(const char* functionName, const String& string)
{
for (size_t i = 0; i < string.length(); ++i) {
+ // line-continuation character \ is supported in WebGL 2.0.
+ if (isWebGL2OrHigher() && string[i] == '\\')
qiankun 2016/06/29 05:31:21 This isn't very accurate to say WebGL 2.0 here. We
Zhenyao Mo 2016/06/29 18:16:07 This is not true. See GLSL ES Spec 3.00.4 page 6,
Ken Russell (switch to Gerrit) 2016/06/30 00:04:31 This particular change (to validateString) seems w
+ continue;
if (!validateCharacter(string[i])) {
synthesizeGLError(GL_INVALID_VALUE, functionName, "string not ASCII");
return false;
« 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