| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // A class to emluate GLES2 over command buffers. | 5 // A class to emluate GLES2 over command buffers. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 // TODO(gman): remove when all functions have been implemented. | 8 // TODO(gman): remove when all functions have been implemented. |
| 9 #include "gpu/command_buffer/client/gles2_implementation_gen.h" | 9 #include "gpu/command_buffer/client/gles2_implementation_gen.h" |
| 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 void GLES2Implementation::WaitForCmd() { | 59 void GLES2Implementation::WaitForCmd() { |
| 60 int32 token = helper_->InsertToken(); | 60 int32 token = helper_->InsertToken(); |
| 61 helper_->WaitForToken(token); | 61 helper_->WaitForToken(token); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void GLES2Implementation::DrawElements( | 64 void GLES2Implementation::DrawElements( |
| 65 GLenum mode, GLsizei count, GLenum type, const void* indices) { | 65 GLenum mode, GLsizei count, GLenum type, const void* indices) { |
| 66 helper_->DrawElements(mode, count, type, ToGLuint(indices)); | 66 helper_->DrawElements(mode, count, type, ToGLuint(indices)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void GLES2Implementation::Finish() { |
| 70 helper_->Finish(); |
| 71 WaitForCmd(); |
| 72 } |
| 73 |
| 74 void GLES2Implementation::SwapBuffers() { |
| 75 helper_->SwapBuffers(); |
| 76 Finish(); |
| 77 } |
| 78 |
| 69 GLint GLES2Implementation::GetAttribLocation( | 79 GLint GLES2Implementation::GetAttribLocation( |
| 70 GLuint program, const char* name) { | 80 GLuint program, const char* name) { |
| 71 helper_->GetAttribLocationImmediate( | 81 helper_->GetAttribLocationImmediate( |
| 72 program, name, result_shm_id(), result_shm_offset()); | 82 program, name, result_shm_id(), result_shm_offset()); |
| 73 WaitForCmd(); | 83 WaitForCmd(); |
| 74 return GetResultAs<GLint>(); | 84 return GetResultAs<GLint>(); |
| 75 } | 85 } |
| 76 | 86 |
| 77 GLint GLES2Implementation::GetUniformLocation( | 87 GLint GLES2Implementation::GetUniformLocation( |
| 78 GLuint program, const char* name) { | 88 GLuint program, const char* name) { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 } | 265 } |
| 256 ++yoffset; | 266 ++yoffset; |
| 257 source += padded_row_size; | 267 source += padded_row_size; |
| 258 } | 268 } |
| 259 } | 269 } |
| 260 } | 270 } |
| 261 | 271 |
| 262 | 272 |
| 263 } // namespace gles2 | 273 } // namespace gles2 |
| 264 } // namespace gpu | 274 } // namespace gpu |
| OLD | NEW |