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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
233 void RenderTimer::TimerCallback(CFRunLoopTimerRef timer, void* info) { | 233 void RenderTimer::TimerCallback(CFRunLoopTimerRef timer, void* info) { |
234 HANDLE_CRASHES; | 234 HANDLE_CRASHES; |
235 int instance_count = instances_.size(); | 235 int instance_count = instances_.size(); |
236 for (int i = 0; i < instance_count; ++i) { | 236 for (int i = 0; i < instance_count; ++i) { |
237 NPP instance = instances_[i]; | 237 NPP instance = instances_[i]; |
238 PluginObject* obj = static_cast<PluginObject*>(instance->pdata); | 238 PluginObject* obj = static_cast<PluginObject*>(instance->pdata); |
239 | 239 |
240 // RenderClient() may cause events to be processed, leading to | 240 // RenderClient() and Tick() may cause events to be processed, |
241 // reentrant calling of this code. Detect and avoid this case. | 241 // leading to reentrant calling of this code. Detect and avoid |
242 if (obj->client()->IsRendering()) { | 242 // this case. |
| 243 if (obj->client()->IsRendering() || obj->client()->IsTicking()) { |
243 continue; | 244 continue; |
244 } | 245 } |
245 | 246 |
246 bool in_fullscreen = obj->GetFullscreenMacWindow(); | 247 bool in_fullscreen = obj->GetFullscreenMacWindow(); |
247 | 248 |
248 if (obj->drawing_model_ == NPDrawingModelCoreAnimation && | 249 if (obj->drawing_model_ == NPDrawingModelCoreAnimation && |
249 !in_fullscreen) { | 250 !in_fullscreen) { |
250 O3DLayer* o3dLayer = static_cast<O3DLayer*>(obj->gl_layer_); | 251 O3DLayer* o3dLayer = static_cast<O3DLayer*>(obj->gl_layer_); |
251 if (o3dLayer) { | 252 if (o3dLayer) { |
252 obj->client()->Tick(); | 253 obj->client()->Tick(); |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 | 686 |
686 void PluginObject::SetMacCGLContext(CGLContextObj context) { | 687 void PluginObject::SetMacCGLContext(CGLContextObj context) { |
687 mac_cgl_context_ = context; | 688 mac_cgl_context_ = context; |
688 if (renderer_) { | 689 if (renderer_) { |
689 ((o3d::RendererGL*) renderer_)->set_mac_cgl_context(context); | 690 ((o3d::RendererGL*) renderer_)->set_mac_cgl_context(context); |
690 } | 691 } |
691 } | 692 } |
692 | 693 |
693 } // namespace glue | 694 } // namespace glue |
694 } // namespace o3d | 695 } // namespace o3d |
OLD | NEW |