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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 void RenderWidgetFullscreenPepper::CreateContext() { | 526 void RenderWidgetFullscreenPepper::CreateContext() { |
527 DCHECK(!context_); | 527 DCHECK(!context_); |
528 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 528 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
529 if (command_line->HasSwitch(switches::kDisableFlashFullscreen3d)) | 529 if (command_line->HasSwitch(switches::kDisableFlashFullscreen3d)) |
530 return; | 530 return; |
531 WebKit::WebGraphicsContext3D::Attributes attributes; | 531 WebKit::WebGraphicsContext3D::Attributes attributes; |
532 attributes.depth = false; | 532 attributes.depth = false; |
533 attributes.stencil = false; | 533 attributes.stencil = false; |
534 attributes.antialias = false; | 534 attributes.antialias = false; |
535 attributes.shareResources = false; | 535 attributes.shareResources = false; |
| 536 attributes.preferDiscreteGPU = true; |
536 context_ = WebGraphicsContext3DCommandBufferImpl::CreateViewContext( | 537 context_ = WebGraphicsContext3DCommandBufferImpl::CreateViewContext( |
537 RenderThreadImpl::current(), | 538 RenderThreadImpl::current(), |
538 surface_id(), | 539 surface_id(), |
539 NULL, | 540 NULL, |
540 attributes, | 541 attributes, |
541 true /* bind generates resources */, | 542 true /* bind generates resources */, |
542 active_url_, | 543 active_url_, |
543 CAUSE_FOR_GPU_LAUNCH_RENDERWIDGETFULLSCREENPEPPER_CREATECONTEXT); | 544 CAUSE_FOR_GPU_LAUNCH_RENDERWIDGETFULLSCREENPEPPER_CREATECONTEXT); |
544 if (!context_) | 545 if (!context_) |
545 return; | 546 return; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { | 674 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { |
674 if (!context_) { | 675 if (!context_) { |
675 CreateContext(); | 676 CreateContext(); |
676 } | 677 } |
677 if (!context_) | 678 if (!context_) |
678 return NULL; | 679 return NULL; |
679 return context_; | 680 return context_; |
680 } | 681 } |
681 | 682 |
682 } // namespace content | 683 } // namespace content |
OLD | NEW |