| 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 #include "gpu/command_buffer/tests/gl_manager.h" | 5 #include "gpu/command_buffer/tests/gl_manager.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 #include <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
| 10 | 10 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 scoped_refptr<gfx::GLSurface>* GLManager::base_surface_; | 182 scoped_refptr<gfx::GLSurface>* GLManager::base_surface_; |
| 183 scoped_refptr<gfx::GLContext>* GLManager::base_context_; | 183 scoped_refptr<gfx::GLContext>* GLManager::base_context_; |
| 184 | 184 |
| 185 GLManager::Options::Options() | 185 GLManager::Options::Options() |
| 186 : size(4, 4), | 186 : size(4, 4), |
| 187 share_group_manager(NULL), | 187 share_group_manager(NULL), |
| 188 share_mailbox_manager(NULL), | 188 share_mailbox_manager(NULL), |
| 189 virtual_manager(NULL), | 189 virtual_manager(NULL), |
| 190 bind_generates_resource(false), | 190 bind_generates_resource(false), |
| 191 lose_context_when_out_of_memory(false), | 191 lose_context_when_out_of_memory(false), |
| 192 context_lost_allowed(false) { | 192 context_lost_allowed(false), |
| 193 webgl_version(0) { |
| 193 } | 194 } |
| 194 | 195 |
| 195 GLManager::GLManager() : context_lost_allowed_(false) { | 196 GLManager::GLManager() : context_lost_allowed_(false) { |
| 196 SetupBaseContext(); | 197 SetupBaseContext(); |
| 197 } | 198 } |
| 198 | 199 |
| 199 GLManager::~GLManager() { | 200 GLManager::~GLManager() { |
| 200 --use_count_; | 201 --use_count_; |
| 201 if (!use_count_) { | 202 if (!use_count_) { |
| 202 if (base_share_group_) { | 203 if (base_share_group_) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 271 |
| 271 gfx::GpuPreference gpu_preference(gfx::PreferDiscreteGpu); | 272 gfx::GpuPreference gpu_preference(gfx::PreferDiscreteGpu); |
| 272 std::vector<int32> attribs; | 273 std::vector<int32> attribs; |
| 273 gles2::ContextCreationAttribHelper attrib_helper; | 274 gles2::ContextCreationAttribHelper attrib_helper; |
| 274 attrib_helper.red_size = 8; | 275 attrib_helper.red_size = 8; |
| 275 attrib_helper.green_size = 8; | 276 attrib_helper.green_size = 8; |
| 276 attrib_helper.blue_size = 8; | 277 attrib_helper.blue_size = 8; |
| 277 attrib_helper.alpha_size = 8; | 278 attrib_helper.alpha_size = 8; |
| 278 attrib_helper.depth_size = 16; | 279 attrib_helper.depth_size = 16; |
| 279 attrib_helper.stencil_size = 8; | 280 attrib_helper.stencil_size = 8; |
| 281 attrib_helper.webgl_version = options.webgl_version; |
| 280 attrib_helper.Serialize(&attribs); | 282 attrib_helper.Serialize(&attribs); |
| 281 | 283 |
| 282 DCHECK(!command_line || !context_group); | 284 DCHECK(!command_line || !context_group); |
| 283 if (!context_group) { | 285 if (!context_group) { |
| 284 scoped_refptr<gles2::FeatureInfo> feature_info; | 286 scoped_refptr<gles2::FeatureInfo> feature_info; |
| 285 if (command_line) | 287 if (command_line) |
| 286 feature_info = new gles2::FeatureInfo(*command_line); | 288 feature_info = new gles2::FeatureInfo(*command_line); |
| 287 context_group = | 289 context_group = |
| 288 new gles2::ContextGroup(mailbox_manager_.get(), | 290 new gles2::ContextGroup(mailbox_manager_.get(), |
| 289 NULL, | 291 NULL, |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 uint32 GLManager::CreateStreamTexture(uint32 texture_id) { | 512 uint32 GLManager::CreateStreamTexture(uint32 texture_id) { |
| 511 NOTIMPLEMENTED(); | 513 NOTIMPLEMENTED(); |
| 512 return 0; | 514 return 0; |
| 513 } | 515 } |
| 514 | 516 |
| 515 void GLManager::SetLock(base::Lock*) { | 517 void GLManager::SetLock(base::Lock*) { |
| 516 NOTIMPLEMENTED(); | 518 NOTIMPLEMENTED(); |
| 517 } | 519 } |
| 518 | 520 |
| 519 } // namespace gpu | 521 } // namespace gpu |
| OLD | NEW |