| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 features_ = NULL; | 224 features_ = NULL; |
| 225 | 225 |
| 226 // There is a reference cycle between the V8 bridge and the plugin. | 226 // There is a reference cycle between the V8 bridge and the plugin. |
| 227 // Explicitly remove all V8 references during tear-down, so that the cycle is | 227 // Explicitly remove all V8 references during tear-down, so that the cycle is |
| 228 // broken, and the reference counting system will successfully delete the | 228 // broken, and the reference counting system will successfully delete the |
| 229 // plugin. | 229 // plugin. |
| 230 np_v8_bridge_.ReleaseNPObjects(); | 230 np_v8_bridge_.ReleaseNPObjects(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void PluginObject::CreateRenderer(const o3d::DisplayWindow& display_window) { | 233 void PluginObject::CreateRenderer(const o3d::DisplayWindow& display_window) { |
| 234 renderer_ = o3d::Renderer::CreateDefaultRenderer(&service_locator_); | |
| 235 DCHECK(renderer_); | |
| 236 | |
| 237 if (!CheckConfig(npp_)) { | 234 if (!CheckConfig(npp_)) { |
| 238 renderer_init_status_ = o3d::Renderer::GPU_NOT_UP_TO_SPEC; | 235 renderer_init_status_ = o3d::Renderer::GPU_NOT_UP_TO_SPEC; |
| 239 } else { | 236 } else { |
| 237 renderer_ = o3d::Renderer::CreateDefaultRenderer(&service_locator_); |
| 238 DCHECK(renderer_); |
| 239 |
| 240 // Attempt to initialize renderer. | 240 // Attempt to initialize renderer. |
| 241 renderer_init_status_ = renderer_->Init(display_window, false); | 241 renderer_init_status_ = renderer_->Init(display_window, false); |
| 242 if (renderer_init_status_ != o3d::Renderer::SUCCESS) { | 242 if (renderer_init_status_ != o3d::Renderer::SUCCESS) { |
| 243 DeleteRenderer(); | 243 DeleteRenderer(); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 | 247 |
| 248 void PluginObject::DeleteRenderer() { | 248 void PluginObject::DeleteRenderer() { |
| 249 if (renderer_) { | 249 if (renderer_) { |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 PluginObject *plugin_object = static_cast<PluginObject *>(npp->pdata); | 878 PluginObject *plugin_object = static_cast<PluginObject *>(npp->pdata); |
| 879 if (plugin_object) { // May not be initialized yet. | 879 if (plugin_object) { // May not be initialized yet. |
| 880 return plugin_object->client()->ProfileToString(); | 880 return plugin_object->client()->ProfileToString(); |
| 881 } else { | 881 } else { |
| 882 return ""; | 882 return ""; |
| 883 } | 883 } |
| 884 } | 884 } |
| 885 | 885 |
| 886 } // namespace globals | 886 } // namespace globals |
| 887 } // namespace glue | 887 } // namespace glue |
| OLD | NEW |