| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 return platform_context_->GetGpuControl(); | 190 return platform_context_->GetGpuControl(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 int32 PPB_Graphics3D_Impl::DoSwapBuffers() { | 193 int32 PPB_Graphics3D_Impl::DoSwapBuffers() { |
| 194 // We do not have a GLES2 implementation when using an OOP proxy. | 194 // We do not have a GLES2 implementation when using an OOP proxy. |
| 195 // The plugin-side proxy is responsible for adding the SwapBuffers command | 195 // The plugin-side proxy is responsible for adding the SwapBuffers command |
| 196 // to the command buffer in that case. | 196 // to the command buffer in that case. |
| 197 if (gles2_impl()) | 197 if (gles2_impl()) |
| 198 gles2_impl()->SwapBuffers(); | 198 gles2_impl()->SwapBuffers(); |
| 199 | 199 |
| 200 // Since the backing texture has been updated, a new sync point should be |
| 201 // inserted. |
| 202 platform_context_->InsertSyncPointForBackingMailbox(); |
| 203 |
| 200 if (bound_to_instance_) { | 204 if (bound_to_instance_) { |
| 201 // If we are bound to the instance, we need to ask the compositor | 205 // If we are bound to the instance, we need to ask the compositor |
| 202 // to commit our backing texture so that the graphics appears on the page. | 206 // to commit our backing texture so that the graphics appears on the page. |
| 203 // When the backing texture will be committed we get notified via | 207 // When the backing texture will be committed we get notified via |
| 204 // ViewFlushedPaint(). | 208 // ViewFlushedPaint(). |
| 205 // | 209 // |
| 206 // Don't need to check for NULL from GetPluginInstance since when we're | 210 // Don't need to check for NULL from GetPluginInstance since when we're |
| 207 // bound, we know our instance is valid. | 211 // bound, we know our instance is valid. |
| 208 HostGlobals::Get()->GetInstance(pp_instance())->CommitBackingTexture(); | 212 HostGlobals::Get()->GetInstance(pp_instance())->CommitBackingTexture(); |
| 209 commit_pending_ = true; | 213 commit_pending_ = true; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 PPP_GRAPHICS_3D_INTERFACE)); | 340 PPP_GRAPHICS_3D_INTERFACE)); |
| 337 // We have to check *again* that the instance exists, because it could have | 341 // We have to check *again* that the instance exists, because it could have |
| 338 // been deleted during GetPluginInterface(). Even the PluginModule could be | 342 // been deleted during GetPluginInterface(). Even the PluginModule could be |
| 339 // deleted, but in that case, the instance should also be gone, so the | 343 // deleted, but in that case, the instance should also be gone, so the |
| 340 // GetInstance check covers both cases. | 344 // GetInstance check covers both cases. |
| 341 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) | 345 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) |
| 342 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); | 346 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); |
| 343 } | 347 } |
| 344 | 348 |
| 345 } // namespace content | 349 } // namespace content |
| OLD | NEW |