| 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 "content/renderer/pepper/ppb_graphics_3d_impl.h" | 5 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 if (!bound_to_instance_) | 280 if (!bound_to_instance_) |
| 281 return; | 281 return; |
| 282 WebPluginContainer* container = | 282 WebPluginContainer* container = |
| 283 HostGlobals::Get()->GetInstance(pp_instance())->container(); | 283 HostGlobals::Get()->GetInstance(pp_instance())->container(); |
| 284 if (!container) | 284 if (!container) |
| 285 return; | 285 return; |
| 286 WebFrame* frame = container->element().document().frame(); | 286 WebFrame* frame = container->element().document().frame(); |
| 287 if (!frame) | 287 if (!frame) |
| 288 return; | 288 return; |
| 289 WebConsoleMessage console_message = WebConsoleMessage( | 289 WebConsoleMessage console_message = WebConsoleMessage( |
| 290 WebConsoleMessage::LevelError, WebString(UTF8ToUTF16(message))); | 290 WebConsoleMessage::LevelError, WebString(base::UTF8ToUTF16(message))); |
| 291 frame->addMessageToConsole(console_message); | 291 frame->addMessageToConsole(console_message); |
| 292 } | 292 } |
| 293 | 293 |
| 294 void PPB_Graphics3D_Impl::OnSwapBuffers() { | 294 void PPB_Graphics3D_Impl::OnSwapBuffers() { |
| 295 if (HasPendingSwap()) { | 295 if (HasPendingSwap()) { |
| 296 // If we're off-screen, no need to trigger and wait for compositing. | 296 // If we're off-screen, no need to trigger and wait for compositing. |
| 297 // Just send the swap-buffers ACK to the plugin immediately. | 297 // Just send the swap-buffers ACK to the plugin immediately. |
| 298 commit_pending_ = false; | 298 commit_pending_ = false; |
| 299 SwapBuffersACK(PP_OK); | 299 SwapBuffersACK(PP_OK); |
| 300 } | 300 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 PPP_GRAPHICS_3D_INTERFACE)); | 336 PPP_GRAPHICS_3D_INTERFACE)); |
| 337 // We have to check *again* that the instance exists, because it could have | 337 // We have to check *again* that the instance exists, because it could have |
| 338 // been deleted during GetPluginInterface(). Even the PluginModule could be | 338 // been deleted during GetPluginInterface(). Even the PluginModule could be |
| 339 // deleted, but in that case, the instance should also be gone, so the | 339 // deleted, but in that case, the instance should also be gone, so the |
| 340 // GetInstance check covers both cases. | 340 // GetInstance check covers both cases. |
| 341 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) | 341 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) |
| 342 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); | 342 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); |
| 343 } | 343 } |
| 344 | 344 |
| 345 } // namespace content | 345 } // namespace content |
| OLD | NEW |