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

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

Issue 1165553003: Fine tuning glGetInternalformativ. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: 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 7708bc129c7aec036cc6186e7ab3d128beec0a79..e85929912f6af462e57c7e0ddbda2ee017f606fc 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -5685,6 +5685,51 @@ void GLES2Implementation::WaitSync(
CheckGLError();
}
+void GLES2Implementation::GetInternalformativ(
+ GLenum target, GLenum format, GLenum pname,
+ GLsizei buf_size, GLint* params) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetInternalformativ("
+ << GLES2Util::GetStringRenderBufferTarget(target) << ", "
+ << GLES2Util::GetStringRenderBufferFormat(format) << ", "
+ << GLES2Util::GetStringInternalFormatParameter(pname)
+ << ", " << buf_size << ", "
+ << static_cast<const void*>(params) << ")");
+ if (buf_size < 0) {
+ SetGLError(GL_INVALID_VALUE, "glGetInternalformativ", "bufSize < 0");
+ return;
+ }
+ TRACE_EVENT0("gpu", "GLES2Implementation::GetInternalformativ");
+ if (GetInternalformativHelper(target, format, pname, buf_size, params)) {
+ return;
+ }
+ typedef cmds::GetInternalformativ::Result Result;
+ Result* result = GetResultAs<Result*>();
+ if (!result) {
+ return;
+ }
+ result->SetNumResults(0);
+ helper_->GetInternalformativ(target, format, pname,
+ GetResultShmId(), GetResultShmOffset());
+ WaitForCmd();
+ GPU_CLIENT_LOG_CODE_BLOCK({
+ for (int32_t i = 0; i < result->GetNumResults(); ++i) {
+ GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
+ }
+ });
+ if (buf_size > 0 && params) {
+ GLint* data = result->GetData();
+ if (buf_size >= result->GetNumResults()) {
+ buf_size = result->GetNumResults();
+ }
+ for (GLsizei ii = 0; ii < buf_size; ++ii) {
+ params[ii] = data[ii];
+ }
+ }
+ CheckGLError();
+}
+
// Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file
// instead of having to edit some template or the code generator.
« no previous file with comments | « gpu/command_buffer/client/gles2_cmd_helper_autogen.h ('k') | gpu/command_buffer/client/gles2_implementation_impl_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698