| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/service/feature_info.h" | 7 #include "gpu/command_buffer/service/feature_info.h" |
| 8 #include "gpu/command_buffer/service/gl_utils.h" | 8 #include "gpu/command_buffer/service/gl_utils.h" |
| 9 #include "ui/gl/gl_version_info.h" | 9 #include "ui/gl/gl_version_info.h" |
| 10 | 10 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 if (!feature_info_->feature_flags().angle_robust_client_memory || | 161 if (!feature_info_->feature_flags().angle_robust_client_memory || |
| 162 !feature_info_->feature_flags().chromium_bind_generates_resource || | 162 !feature_info_->feature_flags().chromium_bind_generates_resource || |
| 163 (feature_info_->IsWebGLContext() != | 163 (feature_info_->IsWebGLContext() != |
| 164 feature_info_->feature_flags().angle_webgl_compatibility)) { | 164 feature_info_->feature_flags().angle_webgl_compatibility)) { |
| 165 Destroy(true); | 165 Destroy(true); |
| 166 return false; | 166 return false; |
| 167 } | 167 } |
| 168 | 168 |
| 169 image_manager_.reset(new ImageManager()); | 169 image_manager_.reset(new ImageManager()); |
| 170 | 170 |
| 171 fence_manager_.reset(new FenceManager()); |
| 172 |
| 171 bind_generates_resource_ = group_->bind_generates_resource(); | 173 bind_generates_resource_ = group_->bind_generates_resource(); |
| 172 | 174 |
| 173 resources_ = group_->passthrough_resources(); | 175 resources_ = group_->passthrough_resources(); |
| 174 | 176 |
| 175 mailbox_manager_ = group_->mailbox_manager(); | 177 mailbox_manager_ = group_->mailbox_manager(); |
| 176 | 178 |
| 177 // Query information about the texture units | 179 // Query information about the texture units |
| 178 GLint num_texture_units = 0; | 180 GLint num_texture_units = 0; |
| 179 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &num_texture_units); | 181 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &num_texture_units); |
| 180 | 182 |
| 181 active_texture_unit_ = 0; | 183 active_texture_unit_ = 0; |
| 182 bound_textures_.resize(num_texture_units, 0); | 184 bound_textures_.resize(num_texture_units, 0); |
| 183 | 185 |
| 184 if (group_->gpu_preferences().enable_gpu_driver_debug_logging && | 186 if (group_->gpu_preferences().enable_gpu_driver_debug_logging && |
| 185 feature_info_->feature_flags().khr_debug) { | 187 feature_info_->feature_flags().khr_debug) { |
| 186 InitializeGLDebugLogging(); | 188 InitializeGLDebugLogging(); |
| 187 } | 189 } |
| 188 | 190 |
| 189 set_initialized(); | 191 set_initialized(); |
| 190 return true; | 192 return true; |
| 191 } | 193 } |
| 192 | 194 |
| 193 void GLES2DecoderPassthroughImpl::Destroy(bool have_context) { | 195 void GLES2DecoderPassthroughImpl::Destroy(bool have_context) { |
| 194 image_manager_.reset(); | 196 image_manager_.reset(); |
| 195 | 197 |
| 198 if (fence_manager_.get()) { |
| 199 fence_manager_->Destroy(have_context); |
| 200 fence_manager_.reset(); |
| 201 } |
| 202 |
| 196 DeleteServiceObjects( | 203 DeleteServiceObjects( |
| 197 &framebuffer_id_map_, have_context, | 204 &framebuffer_id_map_, have_context, |
| 198 [](GLuint framebuffer) { glDeleteFramebuffersEXT(1, &framebuffer); }); | 205 [](GLuint framebuffer) { glDeleteFramebuffersEXT(1, &framebuffer); }); |
| 199 DeleteServiceObjects(&transform_feedback_id_map_, have_context, | 206 DeleteServiceObjects(&transform_feedback_id_map_, have_context, |
| 200 [](GLuint transform_feedback) { | 207 [](GLuint transform_feedback) { |
| 201 glDeleteTransformFeedbacks(1, &transform_feedback); | 208 glDeleteTransformFeedbacks(1, &transform_feedback); |
| 202 }); | 209 }); |
| 203 DeleteServiceObjects(&query_id_map_, have_context, | 210 DeleteServiceObjects(&query_id_map_, have_context, |
| 204 [](GLuint query) { glDeleteQueries(1, &query); }); | 211 [](GLuint query) { glDeleteQueries(1, &query); }); |
| 205 DeleteServiceObjects( | 212 DeleteServiceObjects( |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 | 418 |
| 412 gpu::gles2::VertexArrayManager* | 419 gpu::gles2::VertexArrayManager* |
| 413 GLES2DecoderPassthroughImpl::GetVertexArrayManager() { | 420 GLES2DecoderPassthroughImpl::GetVertexArrayManager() { |
| 414 return nullptr; | 421 return nullptr; |
| 415 } | 422 } |
| 416 | 423 |
| 417 gpu::gles2::ImageManager* GLES2DecoderPassthroughImpl::GetImageManager() { | 424 gpu::gles2::ImageManager* GLES2DecoderPassthroughImpl::GetImageManager() { |
| 418 return image_manager_.get(); | 425 return image_manager_.get(); |
| 419 } | 426 } |
| 420 | 427 |
| 428 gpu::gles2::FenceManager* GLES2DecoderPassthroughImpl::GetFenceManager() { |
| 429 return fence_manager_.get(); |
| 430 } |
| 431 |
| 421 bool GLES2DecoderPassthroughImpl::HasPendingQueries() const { | 432 bool GLES2DecoderPassthroughImpl::HasPendingQueries() const { |
| 422 return false; | 433 return false; |
| 423 } | 434 } |
| 424 | 435 |
| 425 void GLES2DecoderPassthroughImpl::ProcessPendingQueries(bool did_finish) {} | 436 void GLES2DecoderPassthroughImpl::ProcessPendingQueries(bool did_finish) {} |
| 426 | 437 |
| 427 bool GLES2DecoderPassthroughImpl::HasMoreIdleWork() const { | 438 bool GLES2DecoderPassthroughImpl::HasMoreIdleWork() const { |
| 428 return false; | 439 return false; |
| 429 } | 440 } |
| 430 | 441 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 }, /* NOLINT */ | 550 }, /* NOLINT */ |
| 540 | 551 |
| 541 const GLES2DecoderPassthroughImpl::CommandInfo | 552 const GLES2DecoderPassthroughImpl::CommandInfo |
| 542 GLES2DecoderPassthroughImpl::command_info[] = { | 553 GLES2DecoderPassthroughImpl::command_info[] = { |
| 543 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; | 554 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; |
| 544 | 555 |
| 545 #undef GLES2_CMD_OP | 556 #undef GLES2_CMD_OP |
| 546 | 557 |
| 547 } // namespace gles2 | 558 } // namespace gles2 |
| 548 } // namespace gpu | 559 } // namespace gpu |
| OLD | NEW |