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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 // fill rate like most notebooks, and the Mac implementation would need to | 605 // fill rate like most notebooks, and the Mac implementation would need to |
606 // be optimized to resolve directly into the IOSurface shared between the | 606 // be optimized to resolve directly into the IOSurface shared between the |
607 // GPU and browser processes. For these reasons and to avoid platform | 607 // GPU and browser processes. For these reasons and to avoid platform |
608 // disparities we explicitly disable antialiasing. | 608 // disparities we explicitly disable antialiasing. |
609 WebKit::WebGraphicsContext3D::Attributes attributes; | 609 WebKit::WebGraphicsContext3D::Attributes attributes; |
610 attributes.antialias = false; | 610 attributes.antialias = false; |
611 attributes.shareResources = true; | 611 attributes.shareResources = true; |
612 attributes.noAutomaticFlushes = true; | 612 attributes.noAutomaticFlushes = true; |
613 attributes.depth = false; | 613 attributes.depth = false; |
614 attributes.stencil = false; | 614 attributes.stencil = false; |
| 615 if (command_line.HasSwitch(cc::switches::kForceDirectLayerDrawing)) |
| 616 attributes.stencil = true; |
615 WebGraphicsContext3DCommandBufferImpl* context = | 617 WebGraphicsContext3DCommandBufferImpl* context = |
616 CreateGraphicsContext3D(attributes); | 618 CreateGraphicsContext3D(attributes); |
617 if (!context) | 619 if (!context) |
618 return scoped_ptr<cc::OutputSurface>(); | 620 return scoped_ptr<cc::OutputSurface>(); |
619 | 621 |
620 bool composite_to_mailbox = | 622 bool composite_to_mailbox = |
621 command_line.HasSwitch(cc::switches::kCompositeToMailbox) && | 623 command_line.HasSwitch(cc::switches::kCompositeToMailbox) && |
622 !command_line.HasSwitch(switches::kEnableDelegatedRenderer); | 624 !command_line.HasSwitch(switches::kEnableDelegatedRenderer); |
623 // No swap throttling yet when compositing on the main thread. | 625 // No swap throttling yet when compositing on the main thread. |
624 DCHECK(!composite_to_mailbox || is_threaded_compositing_enabled_); | 626 DCHECK(!composite_to_mailbox || is_threaded_compositing_enabled_); |
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2371 | 2373 |
2372 if (!context->Initialize( | 2374 if (!context->Initialize( |
2373 attributes, | 2375 attributes, |
2374 false /* bind generates resources */, | 2376 false /* bind generates resources */, |
2375 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) | 2377 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) |
2376 return NULL; | 2378 return NULL; |
2377 return context.release(); | 2379 return context.release(); |
2378 } | 2380 } |
2379 | 2381 |
2380 } // namespace content | 2382 } // namespace content |
OLD | NEW |