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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 std::stringstream ss; | 174 std::stringstream ss; |
175 ss << std::hex << this; | 175 ss << std::hex << this; |
176 this_in_hex_ = ss.str(); | 176 this_in_hex_ = ss.str(); |
177 | 177 |
178 GPU_CLIENT_LOG_CODE_BLOCK({ | 178 GPU_CLIENT_LOG_CODE_BLOCK({ |
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 ? std::move(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 | 189 |
190 memset(&reserved_ids_, 0, sizeof(reserved_ids_)); | 190 memset(&reserved_ids_, 0, sizeof(reserved_ids_)); |
191 } | 191 } |
192 | 192 |
193 bool GLES2Implementation::Initialize( | 193 bool GLES2Implementation::Initialize( |
194 unsigned int starting_transfer_buffer_size, | 194 unsigned int starting_transfer_buffer_size, |
(...skipping 6622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6817 cached_extensions_.clear(); | 6817 cached_extensions_.clear(); |
6818 } | 6818 } |
6819 | 6819 |
6820 // Include the auto-generated part of this file. We split this because it means | 6820 // Include the auto-generated part of this file. We split this because it means |
6821 // we can easily edit the non-auto generated parts right here in this file | 6821 // we can easily edit the non-auto generated parts right here in this file |
6822 // instead of having to edit some template or the code generator. | 6822 // instead of having to edit some template or the code generator. |
6823 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 6823 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
6824 | 6824 |
6825 } // namespace gles2 | 6825 } // namespace gles2 |
6826 } // namespace gpu | 6826 } // namespace gpu |
OLD | NEW |