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/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/command_line.h" |
8 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
9 #include "content/common/gpu/client/gpu_channel_host.h" | 10 #include "content/common/gpu/client/gpu_channel_host.h" |
10 #include "content/common/view_messages.h" | 11 #include "content/common/view_messages.h" |
| 12 #include "content/public/common/content_switches.h" |
11 #include "content/renderer/pepper/pepper_platform_context_3d_impl.h" | 13 #include "content/renderer/pepper/pepper_platform_context_3d_impl.h" |
12 #include "content/renderer/render_thread_impl.h" | 14 #include "content/renderer/render_thread_impl.h" |
13 #include "gpu/command_buffer/client/gles2_implementation.h" | 15 #include "gpu/command_buffer/client/gles2_implementation.h" |
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" |
18 #include "ui/gl/gpu_preference.h" | 20 #include "ui/gl/gpu_preference.h" |
19 #include "webkit/plugins/ppapi/plugin_delegate.h" | 21 #include "webkit/plugins/ppapi/plugin_delegate.h" |
20 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 22 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 WebWidget* RenderWidgetFullscreenPepper::CreateWebWidget() { | 427 WebWidget* RenderWidgetFullscreenPepper::CreateWebWidget() { |
426 return new PepperWidget(this); | 428 return new PepperWidget(this); |
427 } | 429 } |
428 | 430 |
429 bool RenderWidgetFullscreenPepper::SupportsAsynchronousSwapBuffers() { | 431 bool RenderWidgetFullscreenPepper::SupportsAsynchronousSwapBuffers() { |
430 return context_ != NULL; | 432 return context_ != NULL; |
431 } | 433 } |
432 | 434 |
433 void RenderWidgetFullscreenPepper::CreateContext() { | 435 void RenderWidgetFullscreenPepper::CreateContext() { |
434 DCHECK(!context_); | 436 DCHECK(!context_); |
| 437 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 438 if (command_line->HasSwitch(switches::kDisableFlashFullscreen3d)) |
| 439 return; |
435 WebKit::WebGraphicsContext3D::Attributes attributes; | 440 WebKit::WebGraphicsContext3D::Attributes attributes; |
436 attributes.depth = false; | 441 attributes.depth = false; |
437 attributes.stencil = false; | 442 attributes.stencil = false; |
438 attributes.antialias = false; | 443 attributes.antialias = false; |
439 attributes.shareResources = false; | 444 attributes.shareResources = false; |
440 context_ = WebGraphicsContext3DCommandBufferImpl::CreateViewContext( | 445 context_ = WebGraphicsContext3DCommandBufferImpl::CreateViewContext( |
441 RenderThreadImpl::current(), | 446 RenderThreadImpl::current(), |
442 surface_id(), | 447 surface_id(), |
443 NULL, | 448 NULL, |
444 attributes, | 449 attributes, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 | 580 |
576 WebGraphicsContext3DCommandBufferImpl* | 581 WebGraphicsContext3DCommandBufferImpl* |
577 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { | 582 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { |
578 if (!context_) { | 583 if (!context_) { |
579 CreateContext(); | 584 CreateContext(); |
580 } | 585 } |
581 if (!context_) | 586 if (!context_) |
582 return NULL; | 587 return NULL; |
583 return context_; | 588 return context_; |
584 } | 589 } |
OLD | NEW |