| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 texture_object_map.clear(); | 69 texture_object_map.clear(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group) | 72 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group) |
| 73 : commands_to_process_(0), | 73 : commands_to_process_(0), |
| 74 debug_marker_manager_(), | 74 debug_marker_manager_(), |
| 75 logger_(&debug_marker_manager_), | 75 logger_(&debug_marker_manager_), |
| 76 surface_(), | 76 surface_(), |
| 77 context_(), | 77 context_(), |
| 78 offscreen_(false), |
| 78 group_(group), | 79 group_(group), |
| 79 feature_info_(group->feature_info()) { | 80 feature_info_(group->feature_info()) { |
| 80 DCHECK(group); | 81 DCHECK(group); |
| 81 } | 82 } |
| 82 | 83 |
| 83 GLES2DecoderPassthroughImpl::~GLES2DecoderPassthroughImpl() {} | 84 GLES2DecoderPassthroughImpl::~GLES2DecoderPassthroughImpl() {} |
| 84 | 85 |
| 85 GLES2Decoder::Error GLES2DecoderPassthroughImpl::DoCommands( | 86 GLES2Decoder::Error GLES2DecoderPassthroughImpl::DoCommands( |
| 86 unsigned int num_commands, | 87 unsigned int num_commands, |
| 87 const volatile void* buffer, | 88 const volatile void* buffer, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 bool GLES2DecoderPassthroughImpl::Initialize( | 155 bool GLES2DecoderPassthroughImpl::Initialize( |
| 155 const scoped_refptr<gl::GLSurface>& surface, | 156 const scoped_refptr<gl::GLSurface>& surface, |
| 156 const scoped_refptr<gl::GLContext>& context, | 157 const scoped_refptr<gl::GLContext>& context, |
| 157 bool offscreen, | 158 bool offscreen, |
| 158 const DisallowedFeatures& disallowed_features, | 159 const DisallowedFeatures& disallowed_features, |
| 159 const ContextCreationAttribHelper& attrib_helper) { | 160 const ContextCreationAttribHelper& attrib_helper) { |
| 160 // Take ownership of the context and surface. The surface can be replaced | 161 // Take ownership of the context and surface. The surface can be replaced |
| 161 // with SetSurface. | 162 // with SetSurface. |
| 162 context_ = context; | 163 context_ = context; |
| 163 surface_ = surface; | 164 surface_ = surface; |
| 165 offscreen_ = offscreen; |
| 164 | 166 |
| 165 if (!group_->Initialize(this, attrib_helper.context_type, | 167 if (!group_->Initialize(this, attrib_helper.context_type, |
| 166 disallowed_features)) { | 168 disallowed_features)) { |
| 167 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. | 169 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. |
| 168 Destroy(true); | 170 Destroy(true); |
| 169 return false; | 171 return false; |
| 170 } | 172 } |
| 171 | 173 |
| 172 // Check for required extensions | 174 // Check for required extensions |
| 173 if (!feature_info_->feature_flags().angle_robust_client_memory || | 175 if (!feature_info_->feature_flags().angle_robust_client_memory || |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 }, /* NOLINT */ | 851 }, /* NOLINT */ |
| 850 | 852 |
| 851 const GLES2DecoderPassthroughImpl::CommandInfo | 853 const GLES2DecoderPassthroughImpl::CommandInfo |
| 852 GLES2DecoderPassthroughImpl::command_info[] = { | 854 GLES2DecoderPassthroughImpl::command_info[] = { |
| 853 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; | 855 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; |
| 854 | 856 |
| 855 #undef GLES2_CMD_OP | 857 #undef GLES2_CMD_OP |
| 856 | 858 |
| 857 } // namespace gles2 | 859 } // namespace gles2 |
| 858 } // namespace gpu | 860 } // namespace gpu |
| OLD | NEW |