OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/render_widget_fullscreen_pepper.h" | 5 #include "content/renderer/render_widget_fullscreen_pepper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
10 #include "content/renderer/gpu/gpu_channel_host.h" | 10 #include "content/renderer/gpu/gpu_channel_host.h" |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
479 return compositing; | 479 return compositing; |
480 } | 480 } |
481 | 481 |
482 void RenderWidgetFullscreenPepper::SwapBuffers() { | 482 void RenderWidgetFullscreenPepper::SwapBuffers() { |
483 DCHECK(context_); | 483 DCHECK(context_); |
484 OnSwapBuffersPosted(); | 484 OnSwapBuffersPosted(); |
485 context_->SwapBuffers(); | 485 context_->SwapBuffers(); |
486 context_->Echo(base::Bind( | 486 context_->Echo(base::Bind( |
487 &RenderWidgetFullscreenPepper::OnSwapBuffersCompleteByRendererGLContext, | 487 &RenderWidgetFullscreenPepper::OnSwapBuffersCompleteByRendererGLContext, |
488 weak_ptr_factory_.GetWeakPtr())); | 488 weak_ptr_factory_.GetWeakPtr())); |
489 | |
490 // The compositor isn't actually active in this path, but pretend it is for | |
491 // scheduling purposes. | |
492 if (is_accelerated_compositing_active_) | |
piman
2011/12/01 05:04:05
No need for the if. It should be always true when
| |
493 didCommitAndDrawCompositorFrame(); | |
489 } | 494 } |
490 | 495 |
491 void RenderWidgetFullscreenPepper::OnLostContext( | 496 void RenderWidgetFullscreenPepper::OnLostContext( |
492 RendererGLContext::ContextLostReason) { | 497 RendererGLContext::ContextLostReason) { |
493 if (!context_) | 498 if (!context_) |
494 return; | 499 return; |
495 // Destroy the context later, in case we got called from InitContext for | 500 // Destroy the context later, in case we got called from InitContext for |
496 // example. We still need to reset context_ now so that a new context gets | 501 // example. We still need to reset context_ now so that a new context gets |
497 // created when the plugin recreates its own. | 502 // created when the plugin recreates its own. |
498 MessageLoop::current()->PostTask( | 503 MessageLoop::current()->PostTask( |
(...skipping 12 matching lines...) Expand all Loading... | |
511 | 516 |
512 RendererGLContext* | 517 RendererGLContext* |
513 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { | 518 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { |
514 if (!context_) { | 519 if (!context_) { |
515 CreateContext(); | 520 CreateContext(); |
516 } | 521 } |
517 if (!context_) | 522 if (!context_) |
518 return NULL; | 523 return NULL; |
519 return context_; | 524 return context_; |
520 } | 525 } |
OLD | NEW |