| OLD | NEW |
| 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/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 return true; | 764 return true; |
| 765 case GL_READ_FRAMEBUFFER_BINDING: | 765 case GL_READ_FRAMEBUFFER_BINDING: |
| 766 if (IsChromiumFramebufferMultisampleAvailable()) { | 766 if (IsChromiumFramebufferMultisampleAvailable()) { |
| 767 *params = bound_read_framebuffer_; | 767 *params = bound_read_framebuffer_; |
| 768 return true; | 768 return true; |
| 769 } | 769 } |
| 770 break; | 770 break; |
| 771 case GL_TIMESTAMP_EXT: | 771 case GL_TIMESTAMP_EXT: |
| 772 // We convert all GPU timestamps to CPU time. | 772 // We convert all GPU timestamps to CPU time. |
| 773 *params = base::saturated_cast<GLint>( | 773 *params = base::saturated_cast<GLint>( |
| 774 (base::TraceTicks::Now() - base::TraceTicks()).InMicroseconds() | 774 (base::TimeTicks::Now() - base::TimeTicks()).InMicroseconds() |
| 775 * base::Time::kNanosecondsPerMicrosecond); | 775 * base::Time::kNanosecondsPerMicrosecond); |
| 776 return true; | 776 return true; |
| 777 case GL_GPU_DISJOINT_EXT: | 777 case GL_GPU_DISJOINT_EXT: |
| 778 *params = static_cast<GLint>(query_tracker_->CheckAndResetDisjoint()); | 778 *params = static_cast<GLint>(query_tracker_->CheckAndResetDisjoint()); |
| 779 return true; | 779 return true; |
| 780 | 780 |
| 781 // Non-cached parameters. | 781 // Non-cached parameters. |
| 782 case GL_ALIASED_LINE_WIDTH_RANGE: | 782 case GL_ALIASED_LINE_WIDTH_RANGE: |
| 783 case GL_ALIASED_POINT_SIZE_RANGE: | 783 case GL_ALIASED_POINT_SIZE_RANGE: |
| 784 case GL_ALPHA_BITS: | 784 case GL_ALPHA_BITS: |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 *params = capabilities_.max_element_index; | 1062 *params = capabilities_.max_element_index; |
| 1063 return true; | 1063 return true; |
| 1064 case GL_MAX_SERVER_WAIT_TIMEOUT: | 1064 case GL_MAX_SERVER_WAIT_TIMEOUT: |
| 1065 *params = capabilities_.max_server_wait_timeout; | 1065 *params = capabilities_.max_server_wait_timeout; |
| 1066 return true; | 1066 return true; |
| 1067 case GL_MAX_UNIFORM_BLOCK_SIZE: | 1067 case GL_MAX_UNIFORM_BLOCK_SIZE: |
| 1068 *params = capabilities_.max_uniform_block_size; | 1068 *params = capabilities_.max_uniform_block_size; |
| 1069 return true; | 1069 return true; |
| 1070 case GL_TIMESTAMP_EXT: | 1070 case GL_TIMESTAMP_EXT: |
| 1071 // We convert all GPU timestamps to CPU time. | 1071 // We convert all GPU timestamps to CPU time. |
| 1072 *params = (base::TraceTicks::Now() - base::TraceTicks()).InMicroseconds() | 1072 *params = (base::TimeTicks::Now() - base::TimeTicks()).InMicroseconds() |
| 1073 * base::Time::kNanosecondsPerMicrosecond; | 1073 * base::Time::kNanosecondsPerMicrosecond; |
| 1074 return true; | 1074 return true; |
| 1075 default: | 1075 default: |
| 1076 break; | 1076 break; |
| 1077 } | 1077 } |
| 1078 GLint value; | 1078 GLint value; |
| 1079 if (!GetHelper(pname, &value)) { | 1079 if (!GetHelper(pname, &value)) { |
| 1080 return false; | 1080 return false; |
| 1081 } | 1081 } |
| 1082 *params = static_cast<GLint64>(value); | 1082 *params = static_cast<GLint64>(value); |
| (...skipping 5279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6362 CheckGLError(); | 6362 CheckGLError(); |
| 6363 } | 6363 } |
| 6364 | 6364 |
| 6365 // Include the auto-generated part of this file. We split this because it means | 6365 // Include the auto-generated part of this file. We split this because it means |
| 6366 // we can easily edit the non-auto generated parts right here in this file | 6366 // we can easily edit the non-auto generated parts right here in this file |
| 6367 // instead of having to edit some template or the code generator. | 6367 // instead of having to edit some template or the code generator. |
| 6368 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 6368 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 6369 | 6369 |
| 6370 } // namespace gles2 | 6370 } // namespace gles2 |
| 6371 } // namespace gpu | 6371 } // namespace gpu |
| OLD | NEW |