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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation_impl_autogen.h

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This file is auto-generated from 5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py 6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style: 7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename 8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT! 9 // DO NOT EDIT!
10 10
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 406 }
407 if (height < 0) { 407 if (height < 0) {
408 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D", "height < 0"); 408 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D", "height < 0");
409 return; 409 return;
410 } 410 }
411 helper_->CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, 411 helper_->CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width,
412 height); 412 height);
413 CheckGLError(); 413 CheckGLError();
414 } 414 }
415 415
416 void GLES2Implementation::CopyTexSubImage3D(GLenum target,
417 GLint level,
418 GLint xoffset,
419 GLint yoffset,
420 GLint zoffset,
421 GLint x,
422 GLint y,
423 GLsizei width,
424 GLsizei height) {
425 GPU_CLIENT_SINGLE_THREAD_CHECK();
426 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCopyTexSubImage3D("
427 << GLES2Util::GetStringTexture3DTarget(target) << ", "
428 << level << ", " << xoffset << ", " << yoffset << ", "
429 << zoffset << ", " << x << ", " << y << ", " << width
430 << ", " << height << ")");
431 if (width < 0) {
432 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage3D", "width < 0");
433 return;
434 }
435 if (height < 0) {
436 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage3D", "height < 0");
437 return;
438 }
439 helper_->CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y,
440 width, height);
441 CheckGLError();
442 }
443
416 GLuint GLES2Implementation::CreateProgram() { 444 GLuint GLES2Implementation::CreateProgram() {
417 GPU_CLIENT_SINGLE_THREAD_CHECK(); 445 GPU_CLIENT_SINGLE_THREAD_CHECK();
418 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateProgram(" 446 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateProgram("
419 << ")"); 447 << ")");
420 GLuint client_id; 448 GLuint client_id;
421 GetIdHandler(id_namespaces::kProgramsAndShaders) 449 GetIdHandler(id_namespaces::kProgramsAndShaders)
422 ->MakeIds(this, 0, 1, &client_id); 450 ->MakeIds(this, 0, 1, &client_id);
423 helper_->CreateProgram(client_id); 451 helper_->CreateProgram(client_id);
424 GPU_CLIENT_LOG("returned " << client_id); 452 GPU_CLIENT_LOG("returned " << client_id);
425 CheckGLError(); 453 CheckGLError();
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1933 return; 1961 return;
1934 } 1962 }
1935 if (depth < 0) { 1963 if (depth < 0) {
1936 SetGLError(GL_INVALID_VALUE, "glTexStorage3D", "depth < 0"); 1964 SetGLError(GL_INVALID_VALUE, "glTexStorage3D", "depth < 0");
1937 return; 1965 return;
1938 } 1966 }
1939 helper_->TexStorage3D(target, levels, internalFormat, width, height, depth); 1967 helper_->TexStorage3D(target, levels, internalFormat, width, height, depth);
1940 CheckGLError(); 1968 CheckGLError();
1941 } 1969 }
1942 1970
1971 void GLES2Implementation::TransformFeedbackVaryings(GLuint program,
1972 GLsizei count,
1973 const char* const* varyings,
1974 GLenum buffermode) {
1975 GPU_CLIENT_SINGLE_THREAD_CHECK();
1976 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTransformFeedbackVaryings("
1977 << program << ", " << count << ", "
1978 << static_cast<const void*>(varyings) << ", "
1979 << GLES2Util::GetStringBufferMode(buffermode) << ")");
1980 GPU_CLIENT_LOG_CODE_BLOCK({
1981 for (GLsizei ii = 0; ii < count; ++ii) {
1982 if (varyings[ii]) {
1983 GPU_CLIENT_LOG(" " << ii << ": ---\n" << varyings[ii] << "\n---");
1984 } else {
1985 GPU_CLIENT_LOG(" " << ii << ": NULL");
1986 }
1987 }
1988 });
1989 if (count < 0) {
1990 SetGLError(GL_INVALID_VALUE, "glTransformFeedbackVaryings", "count < 0");
1991 return;
1992 }
1993 // Compute the total size.
1994 base::CheckedNumeric<size_t> total_size = count;
1995 total_size += 1;
1996 total_size *= sizeof(GLint);
1997 if (!total_size.IsValid()) {
1998 SetGLError(GL_INVALID_VALUE, "glTransformFeedbackVaryings", "overflow");
1999 return;
2000 }
2001 size_t header_size = total_size.ValueOrDefault(0);
2002 std::vector<GLint> header(count + 1);
2003 header[0] = static_cast<GLint>(count);
2004 for (GLsizei ii = 0; ii < count; ++ii) {
2005 GLint len = 0;
2006 if (varyings[ii]) {
2007 len = static_cast<GLint>(strlen(varyings[ii]));
2008 }
2009 total_size += len;
2010 total_size += 1; // NULL at the end of each char array.
2011 if (!total_size.IsValid()) {
2012 SetGLError(GL_INVALID_VALUE, "glTransformFeedbackVaryings", "overflow");
2013 return;
2014 }
2015 header[ii + 1] = len;
2016 }
2017 // Pack data into a bucket on the service.
2018 helper_->SetBucketSize(kResultBucketId, total_size.ValueOrDefault(0));
2019 size_t offset = 0;
2020 for (GLsizei ii = 0; ii <= count; ++ii) {
2021 const char* src = (ii == 0) ? reinterpret_cast<const char*>(&header[0])
2022 : varyings[ii - 1];
2023 base::CheckedNumeric<size_t> checked_size =
2024 (ii == 0) ? header_size : static_cast<size_t>(header[ii]);
2025 if (ii > 0) {
2026 checked_size += 1; // NULL in the end.
2027 }
2028 if (!checked_size.IsValid()) {
2029 SetGLError(GL_INVALID_VALUE, "glTransformFeedbackVaryings", "overflow");
2030 return;
2031 }
2032 size_t size = checked_size.ValueOrDefault(0);
2033 while (size) {
2034 ScopedTransferBufferPtr buffer(size, helper_, transfer_buffer_);
2035 if (!buffer.valid() || buffer.size() == 0) {
2036 SetGLError(GL_OUT_OF_MEMORY, "glTransformFeedbackVaryings",
2037 "too large");
2038 return;
2039 }
2040 size_t copy_size = buffer.size();
2041 if (ii > 0 && buffer.size() == size)
2042 --copy_size;
2043 if (copy_size)
2044 memcpy(buffer.address(), src, copy_size);
2045 if (copy_size < buffer.size()) {
2046 // Append NULL in the end.
2047 DCHECK(copy_size + 1 == buffer.size());
2048 char* str = reinterpret_cast<char*>(buffer.address());
2049 str[copy_size] = 0;
2050 }
2051 helper_->SetBucketData(kResultBucketId, offset, buffer.size(),
2052 buffer.shm_id(), buffer.offset());
2053 offset += buffer.size();
2054 src += buffer.size();
2055 size -= buffer.size();
2056 }
2057 }
2058 DCHECK_EQ(total_size.ValueOrDefault(0), offset);
2059 helper_->TransformFeedbackVaryingsBucket(program, kResultBucketId,
2060 buffermode);
2061 helper_->SetBucketSize(kResultBucketId, 0);
2062 CheckGLError();
2063 }
2064
1943 void GLES2Implementation::Uniform1f(GLint location, GLfloat x) { 2065 void GLES2Implementation::Uniform1f(GLint location, GLfloat x) {
1944 GPU_CLIENT_SINGLE_THREAD_CHECK(); 2066 GPU_CLIENT_SINGLE_THREAD_CHECK();
1945 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1f(" << location << ", " 2067 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1f(" << location << ", "
1946 << x << ")"); 2068 << x << ")");
1947 helper_->Uniform1f(location, x); 2069 helper_->Uniform1f(location, x);
1948 CheckGLError(); 2070 CheckGLError();
1949 } 2071 }
1950 2072
1951 void GLES2Implementation::Uniform1fv(GLint location, 2073 void GLES2Implementation::Uniform1fv(GLint location,
1952 GLsizei count, 2074 GLsizei count,
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after
3326 3448
3327 void GLES2Implementation::BlendBarrierKHR() { 3449 void GLES2Implementation::BlendBarrierKHR() {
3328 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3450 GPU_CLIENT_SINGLE_THREAD_CHECK();
3329 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendBarrierKHR(" 3451 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendBarrierKHR("
3330 << ")"); 3452 << ")");
3331 helper_->BlendBarrierKHR(); 3453 helper_->BlendBarrierKHR();
3332 CheckGLError(); 3454 CheckGLError();
3333 } 3455 }
3334 3456
3335 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_ 3457 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698