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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 492009: First batch of GCC fixes for GPU code. (Closed)
Patch Set: Minor fixes Created 11 years 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 | gpu/command_buffer/service/cmd_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 1208a574eba885b98b909e83aec194924edad029..0280d94cdc0fb72c0984848a6cbf85ee58156c8b 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -12,6 +12,11 @@
namespace command_buffer {
namespace gles2 {
+// A 32-bit and 64-bit compatible way of converting a pointer to a GLuint.
+static GLuint ToGLuint(const void* ptr) {
+ return static_cast<GLuint>(reinterpret_cast<size_t>(ptr));
+}
+
GLES2Implementation::GLES2Implementation(
GLES2CmdHelper* helper,
size_t transfer_buffer_size,
@@ -50,7 +55,7 @@ void GLES2Implementation::WaitForCmd() {
void GLES2Implementation::DrawElements(
GLenum mode, GLsizei count, GLenum type, const void* indices) {
- helper_->DrawElements(mode, count, type, reinterpret_cast<GLuint>(indices));
+ helper_->DrawElements(mode, count, type, ToGLuint(indices));
}
GLint GLES2Implementation::GetAttribLocation(
@@ -88,7 +93,7 @@ void GLES2Implementation::VertexAttribPointer(
GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride,
const void* ptr) {
helper_->VertexAttribPointer(index, size, type, normalized, stride,
- reinterpret_cast<GLuint>(ptr));
+ ToGLuint(ptr));
}
void GLES2Implementation::ShaderSource(
@@ -249,5 +254,3 @@ void GLES2Implementation::TexSubImage2D(
} // namespace gles2
} // namespace command_buffer
-
-
« no previous file with comments | « no previous file | gpu/command_buffer/service/cmd_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698