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 4635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4646 const size_t kNumChecks = sizeof(checks)/sizeof(checks[0]); | 4646 const size_t kNumChecks = sizeof(checks)/sizeof(checks[0]); |
4647 for (size_t ii = 0; ii < kNumChecks; ++ii) { | 4647 for (size_t ii = 0; ii < kNumChecks; ++ii) { |
4648 const ExtensionCheck& check = checks[ii]; | 4648 const ExtensionCheck& check = checks[ii]; |
4649 if (*check.status == kUnavailableExtensionStatus && | 4649 if (*check.status == kUnavailableExtensionStatus && |
4650 !strcmp(extension, check.extension)) { | 4650 !strcmp(extension, check.extension)) { |
4651 *check.status = kUnknownExtensionStatus; | 4651 *check.status = kUnknownExtensionStatus; |
4652 } | 4652 } |
4653 } | 4653 } |
4654 } | 4654 } |
4655 | 4655 |
4656 void GLES2Implementation::RateLimitOffscreenContextCHROMIUM() { | |
4657 GPU_CLIENT_SINGLE_THREAD_CHECK(); | |
4658 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glRateLimitOffscreenCHROMIUM()"); | |
4659 // Wait if this would add too many rate limit tokens. | |
4660 if (rate_limit_tokens_.size() == kMaxSwapBuffers) { | |
4661 helper_->WaitForToken(rate_limit_tokens_.front()); | |
4662 rate_limit_tokens_.pop(); | |
4663 } | |
4664 rate_limit_tokens_.push(helper_->InsertToken()); | |
4665 } | |
4666 | |
4667 void GLES2Implementation::GetProgramInfoCHROMIUMHelper( | 4656 void GLES2Implementation::GetProgramInfoCHROMIUMHelper( |
4668 GLuint program, std::vector<int8>* result) { | 4657 GLuint program, std::vector<int8>* result) { |
4669 DCHECK(result); | 4658 DCHECK(result); |
4670 // Clear the bucket so if the command fails nothing will be in it. | 4659 // Clear the bucket so if the command fails nothing will be in it. |
4671 helper_->SetBucketSize(kResultBucketId, 0); | 4660 helper_->SetBucketSize(kResultBucketId, 0); |
4672 helper_->GetProgramInfoCHROMIUM(program, kResultBucketId); | 4661 helper_->GetProgramInfoCHROMIUM(program, kResultBucketId); |
4673 GetBucketContents(kResultBucketId, result); | 4662 GetBucketContents(kResultBucketId, result); |
4674 } | 4663 } |
4675 | 4664 |
4676 void GLES2Implementation::GetProgramInfoCHROMIUM( | 4665 void GLES2Implementation::GetProgramInfoCHROMIUM( |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5887 CheckGLError(); | 5876 CheckGLError(); |
5888 } | 5877 } |
5889 | 5878 |
5890 // Include the auto-generated part of this file. We split this because it means | 5879 // Include the auto-generated part of this file. We split this because it means |
5891 // we can easily edit the non-auto generated parts right here in this file | 5880 // we can easily edit the non-auto generated parts right here in this file |
5892 // instead of having to edit some template or the code generator. | 5881 // instead of having to edit some template or the code generator. |
5893 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 5882 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
5894 | 5883 |
5895 } // namespace gles2 | 5884 } // namespace gles2 |
5896 } // namespace gpu | 5885 } // namespace gpu |
OLD | NEW |