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

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

Issue 1812243003: Remove methods from WebGraphicsContext3D that wrap type casts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simples-tplus
Patch Set: complex-casts: rebase Created 4 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
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 cbb3969024597af40356116aef19adb2d46f2296..1ee0965882d4245a7c0f83ffec7278e95bcf5199 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -2137,7 +2137,7 @@ void WebGLRenderingContextBase::drawElements(GLenum mode, GLsizei count, GLenum
}
clearIfComposited();
- webContext()->drawElements(mode, count, type, static_cast<GLintptr>(offset));
+ contextGL()->DrawElements(mode, count, type, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
markContextChanged(CanvasChanged);
}
@@ -3299,8 +3299,11 @@ long long WebGLRenderingContextBase::getVertexAttribOffset(GLuint index, GLenum
{
if (isContextLost())
return 0;
- GLintptr result = webContext()->getVertexAttribOffset(index, pname);
- return static_cast<long long>(result);
+ GLvoid* result = nullptr;
+ // NOTE: If pname is ever a value that returns more then 1 element
+ // this will corrupt memory.
+ contextGL()->GetVertexAttribPointerv(index, pname, &result);
+ return static_cast<long long>(reinterpret_cast<intptr_t>(result));
}
void WebGLRenderingContextBase::hint(GLenum target, GLenum mode)
@@ -4957,7 +4960,7 @@ void WebGLRenderingContextBase::vertexAttribPointer(ScriptState* scriptState, GL
}
m_boundVertexArrayObject->setArrayBufferForAttrib(index, m_boundArrayBuffer.get());
- webContext()->vertexAttribPointer(index, size, type, normalized, stride, static_cast<GLintptr>(offset));
+ contextGL()->VertexAttribPointer(index, size, type, normalized, stride, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
maybePreserveDefaultVAOObjectWrapper(scriptState);
preserveObjectWrapper(scriptState, m_boundVertexArrayObject, "arraybuffer", index, m_boundArrayBuffer);
}
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLFenceSync.cpp ('k') | third_party/WebKit/Source/modules/webgl/WebGLSync.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698