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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 emulate GLES2 over command buffers. 5 // A class to emulate 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 8
9 #include <GLES2/gl2ext.h> 9 #include <GLES2/gl2ext.h>
10 #include <GLES2/gl2extchromium.h> 10 #include <GLES2/gl2extchromium.h>
(...skipping 5667 matching lines...) Expand 10 before | Expand all | Expand 10 after
5678 GLsync sync, GLbitfield flags, GLuint64 timeout) { 5678 GLsync sync, GLbitfield flags, GLuint64 timeout) {
5679 GPU_CLIENT_SINGLE_THREAD_CHECK(); 5679 GPU_CLIENT_SINGLE_THREAD_CHECK();
5680 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glWaitSync(" << sync << ", " 5680 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glWaitSync(" << sync << ", "
5681 << flags << ", " << timeout << ")"); 5681 << flags << ", " << timeout << ")");
5682 uint32_t v32_0 = 0, v32_1 = 0; 5682 uint32_t v32_0 = 0, v32_1 = 0;
5683 GLES2Util::MapUint64ToTwoUint32(timeout, &v32_0, &v32_1); 5683 GLES2Util::MapUint64ToTwoUint32(timeout, &v32_0, &v32_1);
5684 helper_->WaitSync(ToGLuint(sync), flags, v32_0, v32_1); 5684 helper_->WaitSync(ToGLuint(sync), flags, v32_0, v32_1);
5685 CheckGLError(); 5685 CheckGLError();
5686 } 5686 }
5687 5687
5688 void GLES2Implementation::GetInternalformativ(
5689 GLenum target, GLenum format, GLenum pname,
5690 GLsizei buf_size, GLint* params) {
5691 GPU_CLIENT_SINGLE_THREAD_CHECK();
5692 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
5693 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetInternalformativ("
5694 << GLES2Util::GetStringRenderBufferTarget(target) << ", "
5695 << GLES2Util::GetStringRenderBufferFormat(format) << ", "
5696 << GLES2Util::GetStringInternalFormatParameter(pname)
5697 << ", " << buf_size << ", "
5698 << static_cast<const void*>(params) << ")");
5699 if (buf_size < 0) {
5700 SetGLError(GL_INVALID_VALUE, "glGetInternalformativ", "bufSize < 0");
5701 return;
5702 }
5703 TRACE_EVENT0("gpu", "GLES2Implementation::GetInternalformativ");
5704 if (GetInternalformativHelper(target, format, pname, buf_size, params)) {
5705 return;
5706 }
5707 typedef cmds::GetInternalformativ::Result Result;
5708 Result* result = GetResultAs<Result*>();
5709 if (!result) {
5710 return;
5711 }
5712 result->SetNumResults(0);
5713 helper_->GetInternalformativ(target, format, pname,
5714 GetResultShmId(), GetResultShmOffset());
5715 WaitForCmd();
5716 GPU_CLIENT_LOG_CODE_BLOCK({
5717 for (int32_t i = 0; i < result->GetNumResults(); ++i) {
5718 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
5719 }
5720 });
5721 if (buf_size > 0 && params) {
5722 GLint* data = result->GetData();
5723 if (buf_size >= result->GetNumResults()) {
5724 buf_size = result->GetNumResults();
5725 }
5726 for (GLsizei ii = 0; ii < buf_size; ++ii) {
5727 params[ii] = data[ii];
5728 }
5729 }
5730 CheckGLError();
5731 }
5732
5688 // Include the auto-generated part of this file. We split this because it means 5733 // Include the auto-generated part of this file. We split this because it means
5689 // we can easily edit the non-auto generated parts right here in this file 5734 // we can easily edit the non-auto generated parts right here in this file
5690 // instead of having to edit some template or the code generator. 5735 // instead of having to edit some template or the code generator.
5691 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 5736 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
5692 5737
5693 } // namespace gles2 5738 } // namespace gles2
5694 } // namespace gpu 5739 } // namespace gpu
OLDNEW
« 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