Chromium Code Reviews| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 ++gles2_implementation_->use_count_; | 104 ++gles2_implementation_->use_count_; |
| 105 } | 105 } |
| 106 | 106 |
| 107 GLES2Implementation::SingleThreadChecker::~SingleThreadChecker() { | 107 GLES2Implementation::SingleThreadChecker::~SingleThreadChecker() { |
| 108 --gles2_implementation_->use_count_; | 108 --gles2_implementation_->use_count_; |
| 109 CHECK_EQ(0, gles2_implementation_->use_count_); | 109 CHECK_EQ(0, gles2_implementation_->use_count_); |
| 110 } | 110 } |
| 111 | 111 |
| 112 GLES2Implementation::GLES2Implementation( | 112 GLES2Implementation::GLES2Implementation( |
| 113 GLES2CmdHelper* helper, | 113 GLES2CmdHelper* helper, |
| 114 ShareGroup* share_group, | 114 scoped_refptr<ShareGroup> share_group, |
| 115 TransferBufferInterface* transfer_buffer, | 115 TransferBufferInterface* transfer_buffer, |
| 116 bool bind_generates_resource, | 116 bool bind_generates_resource, |
| 117 bool lose_context_when_out_of_memory, | 117 bool lose_context_when_out_of_memory, |
| 118 bool support_client_side_arrays, | 118 bool support_client_side_arrays, |
| 119 GpuControl* gpu_control) | 119 GpuControl* gpu_control) |
| 120 : helper_(helper), | 120 : helper_(helper), |
| 121 transfer_buffer_(transfer_buffer), | 121 transfer_buffer_(transfer_buffer), |
| 122 chromium_framebuffer_multisample_(kUnknownExtensionStatus), | 122 chromium_framebuffer_multisample_(kUnknownExtensionStatus), |
| 123 pack_alignment_(4), | 123 pack_alignment_(4), |
| 124 pack_row_length_(0), | 124 pack_row_length_(0), |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 debug_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 179 debug_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 180 switches::kEnableGPUClientLogging); | 180 switches::kEnableGPUClientLogging); |
| 181 }); | 181 }); |
| 182 | 182 |
| 183 share_group_ = | 183 share_group_ = |
| 184 (share_group ? share_group | 184 (share_group ? share_group |
| 185 : new ShareGroup( | 185 : new ShareGroup( |
| 186 bind_generates_resource, | 186 bind_generates_resource, |
| 187 gpu_control_->GetCommandBufferID().GetUnsafeValue())); | 187 gpu_control_->GetCommandBufferID().GetUnsafeValue())); |
| 188 DCHECK(share_group_->bind_generates_resource() == bind_generates_resource); | 188 DCHECK(share_group_->bind_generates_resource() == bind_generates_resource); |
| 189 DCHECK(!share_group_->IsLost()); | |
|
piman
2016/04/27 22:09:33
I don't think we want this DCHECK - another thread
danakj
2016/04/28 00:25:58
Ah.. ya fair point. Removed and moved the check to
| |
| 189 | 190 |
| 190 memset(&reserved_ids_, 0, sizeof(reserved_ids_)); | 191 memset(&reserved_ids_, 0, sizeof(reserved_ids_)); |
| 191 } | 192 } |
| 192 | 193 |
| 193 bool GLES2Implementation::Initialize( | 194 bool GLES2Implementation::Initialize( |
| 194 unsigned int starting_transfer_buffer_size, | 195 unsigned int starting_transfer_buffer_size, |
| 195 unsigned int min_transfer_buffer_size, | 196 unsigned int min_transfer_buffer_size, |
| 196 unsigned int max_transfer_buffer_size, | 197 unsigned int max_transfer_buffer_size, |
| 197 unsigned int mapped_memory_limit) { | 198 unsigned int mapped_memory_limit) { |
| 198 TRACE_EVENT0("gpu", "GLES2Implementation::Initialize"); | 199 TRACE_EVENT0("gpu", "GLES2Implementation::Initialize"); |
| (...skipping 6611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6810 cached_extensions_.clear(); | 6811 cached_extensions_.clear(); |
| 6811 } | 6812 } |
| 6812 | 6813 |
| 6813 // Include the auto-generated part of this file. We split this because it means | 6814 // Include the auto-generated part of this file. We split this because it means |
| 6814 // we can easily edit the non-auto generated parts right here in this file | 6815 // we can easily edit the non-auto generated parts right here in this file |
| 6815 // instead of having to edit some template or the code generator. | 6816 // instead of having to edit some template or the code generator. |
| 6816 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 6817 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 6817 | 6818 |
| 6818 } // namespace gles2 | 6819 } // namespace gles2 |
| 6819 } // namespace gpu | 6820 } // namespace gpu |
| OLD | NEW |