| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 ss << std::hex << this; | 140 ss << std::hex << this; |
| 141 this_in_hex_ = ss.str(); | 141 this_in_hex_ = ss.str(); |
| 142 | 142 |
| 143 GPU_CLIENT_LOG_CODE_BLOCK({ | 143 GPU_CLIENT_LOG_CODE_BLOCK({ |
| 144 debug_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 144 debug_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 145 switches::kEnableGPUClientLogging); | 145 switches::kEnableGPUClientLogging); |
| 146 }); | 146 }); |
| 147 | 147 |
| 148 share_group_ = | 148 share_group_ = |
| 149 (share_group ? share_group | 149 (share_group ? share_group |
| 150 : new ShareGroup(bind_generates_resource, | 150 : new ShareGroup( |
| 151 gpu_control_->GetCommandBufferID())); | 151 bind_generates_resource, |
| 152 gpu_control_->GetCommandBufferID().GetUnsafeValue())); |
| 152 DCHECK(share_group_->bind_generates_resource() == bind_generates_resource); | 153 DCHECK(share_group_->bind_generates_resource() == bind_generates_resource); |
| 153 | 154 |
| 154 memset(&reserved_ids_, 0, sizeof(reserved_ids_)); | 155 memset(&reserved_ids_, 0, sizeof(reserved_ids_)); |
| 155 } | 156 } |
| 156 | 157 |
| 157 bool GLES2Implementation::Initialize( | 158 bool GLES2Implementation::Initialize( |
| 158 unsigned int starting_transfer_buffer_size, | 159 unsigned int starting_transfer_buffer_size, |
| 159 unsigned int min_transfer_buffer_size, | 160 unsigned int min_transfer_buffer_size, |
| 160 unsigned int max_transfer_buffer_size, | 161 unsigned int max_transfer_buffer_size, |
| 161 unsigned int mapped_memory_limit) { | 162 unsigned int mapped_memory_limit) { |
| (...skipping 5487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5649 if (sync_token_data.HasData()) { | 5650 if (sync_token_data.HasData()) { |
| 5650 if (!sync_token_data.verified_flush() && | 5651 if (!sync_token_data.verified_flush() && |
| 5651 !gpu_control_->CanWaitUnverifiedSyncToken(&sync_token_data)) { | 5652 !gpu_control_->CanWaitUnverifiedSyncToken(&sync_token_data)) { |
| 5652 SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM", | 5653 SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM", |
| 5653 "Cannot wait on sync_token which has not been verified"); | 5654 "Cannot wait on sync_token which has not been verified"); |
| 5654 return; | 5655 return; |
| 5655 } | 5656 } |
| 5656 | 5657 |
| 5657 helper_->WaitSyncTokenCHROMIUM( | 5658 helper_->WaitSyncTokenCHROMIUM( |
| 5658 static_cast<GLint>(sync_token_data.namespace_id()), | 5659 static_cast<GLint>(sync_token_data.namespace_id()), |
| 5659 sync_token_data.command_buffer_id(), sync_token_data.release_count()); | 5660 sync_token_data.command_buffer_id().GetUnsafeValue(), |
| 5661 sync_token_data.release_count()); |
| 5660 } | 5662 } |
| 5661 } | 5663 } |
| 5662 } | 5664 } |
| 5663 | 5665 |
| 5664 namespace { | 5666 namespace { |
| 5665 | 5667 |
| 5666 bool ValidImageFormat(GLenum internalformat, | 5668 bool ValidImageFormat(GLenum internalformat, |
| 5667 const Capabilities& capabilities) { | 5669 const Capabilities& capabilities) { |
| 5668 switch (internalformat) { | 5670 switch (internalformat) { |
| 5669 case GL_ATC_RGB_AMD: | 5671 case GL_ATC_RGB_AMD: |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6551 CheckGLError(); | 6553 CheckGLError(); |
| 6552 } | 6554 } |
| 6553 | 6555 |
| 6554 // Include the auto-generated part of this file. We split this because it means | 6556 // Include the auto-generated part of this file. We split this because it means |
| 6555 // we can easily edit the non-auto generated parts right here in this file | 6557 // we can easily edit the non-auto generated parts right here in this file |
| 6556 // instead of having to edit some template or the code generator. | 6558 // instead of having to edit some template or the code generator. |
| 6557 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 6559 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 6558 | 6560 |
| 6559 } // namespace gles2 | 6561 } // namespace gles2 |
| 6560 } // namespace gpu | 6562 } // namespace gpu |
| OLD | NEW |