| 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.h" | 5 #include "content/renderer/render_widget.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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 attributes.antialias = false; | 666 attributes.antialias = false; |
| 667 attributes.shareResources = true; | 667 attributes.shareResources = true; |
| 668 attributes.noAutomaticFlushes = true; | 668 attributes.noAutomaticFlushes = true; |
| 669 attributes.depth = false; | 669 attributes.depth = false; |
| 670 attributes.stencil = false; | 670 attributes.stencil = false; |
| 671 if (command_line.HasSwitch(cc::switches::kForceDirectLayerDrawing)) | 671 if (command_line.HasSwitch(cc::switches::kForceDirectLayerDrawing)) |
| 672 attributes.stencil = true; | 672 attributes.stencil = true; |
| 673 scoped_refptr<ContextProviderCommandBuffer> context_provider; | 673 scoped_refptr<ContextProviderCommandBuffer> context_provider; |
| 674 if (!fallback) { | 674 if (!fallback) { |
| 675 context_provider = ContextProviderCommandBuffer::Create( | 675 context_provider = ContextProviderCommandBuffer::Create( |
| 676 base::Bind(&RenderWidget::CreateGraphicsContext3D, | 676 CreateGraphicsContext3D(attributes)); |
| 677 base::Unretained(this), | |
| 678 attributes)); | |
| 679 } | 677 } |
| 680 | 678 |
| 681 if (!context_provider.get()) { | 679 if (!context_provider.get()) { |
| 682 if (!command_line.HasSwitch(switches::kEnableSoftwareCompositing)) | 680 if (!command_line.HasSwitch(switches::kEnableSoftwareCompositing)) |
| 683 return scoped_ptr<cc::OutputSurface>(); | 681 return scoped_ptr<cc::OutputSurface>(); |
| 684 | 682 |
| 685 scoped_ptr<cc::SoftwareOutputDevice> software_device( | 683 scoped_ptr<cc::SoftwareOutputDevice> software_device( |
| 686 new CompositorSoftwareOutputDevice()); | 684 new CompositorSoftwareOutputDevice()); |
| 687 | 685 |
| 688 return scoped_ptr<cc::OutputSurface>(new CompositorOutputSurface( | 686 return scoped_ptr<cc::OutputSurface>(new CompositorOutputSurface( |
| (...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2543 | 2541 |
| 2544 if (!context->InitializeWithDefaultBufferSizes( | 2542 if (!context->InitializeWithDefaultBufferSizes( |
| 2545 attributes, | 2543 attributes, |
| 2546 false /* bind generates resources */, | 2544 false /* bind generates resources */, |
| 2547 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) | 2545 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) |
| 2548 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); | 2546 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); |
| 2549 return context.Pass(); | 2547 return context.Pass(); |
| 2550 } | 2548 } |
| 2551 | 2549 |
| 2552 } // namespace content | 2550 } // namespace content |
| OLD | NEW |