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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 // Mac OS X essentially always behaves as though it's rendering offscreen. | 598 // Mac OS X essentially always behaves as though it's rendering offscreen. |
599 // Multisampling has a heavy cost especially on devices with relatively low | 599 // Multisampling has a heavy cost especially on devices with relatively low |
600 // fill rate like most notebooks, and the Mac implementation would need to | 600 // fill rate like most notebooks, and the Mac implementation would need to |
601 // be optimized to resolve directly into the IOSurface shared between the | 601 // be optimized to resolve directly into the IOSurface shared between the |
602 // GPU and browser processes. For these reasons and to avoid platform | 602 // GPU and browser processes. For these reasons and to avoid platform |
603 // disparities we explicitly disable antialiasing. | 603 // disparities we explicitly disable antialiasing. |
604 WebKit::WebGraphicsContext3D::Attributes attributes; | 604 WebKit::WebGraphicsContext3D::Attributes attributes; |
605 attributes.antialias = false; | 605 attributes.antialias = false; |
606 attributes.shareResources = true; | 606 attributes.shareResources = true; |
607 attributes.noAutomaticFlushes = true; | 607 attributes.noAutomaticFlushes = true; |
| 608 attributes.depth = false; |
| 609 attributes.stencil = false; |
608 WebGraphicsContext3DCommandBufferImpl* context = | 610 WebGraphicsContext3DCommandBufferImpl* context = |
609 CreateGraphicsContext3D(attributes); | 611 CreateGraphicsContext3D(attributes); |
610 if (!context) | 612 if (!context) |
611 return scoped_ptr<cc::OutputSurface>(); | 613 return scoped_ptr<cc::OutputSurface>(); |
612 | 614 |
613 bool composite_to_mailbox = | 615 bool composite_to_mailbox = |
614 command_line.HasSwitch(cc::switches::kCompositeToMailbox) && | 616 command_line.HasSwitch(cc::switches::kCompositeToMailbox) && |
615 !command_line.HasSwitch(switches::kEnableDelegatedRenderer); | 617 !command_line.HasSwitch(switches::kEnableDelegatedRenderer); |
616 // No swap throttling yet when compositing on the main thread. | 618 // No swap throttling yet when compositing on the main thread. |
617 DCHECK(!composite_to_mailbox || is_threaded_compositing_enabled_); | 619 DCHECK(!composite_to_mailbox || is_threaded_compositing_enabled_); |
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2350 | 2352 |
2351 if (!context->Initialize( | 2353 if (!context->Initialize( |
2352 attributes, | 2354 attributes, |
2353 false /* bind generates resources */, | 2355 false /* bind generates resources */, |
2354 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) | 2356 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) |
2355 return NULL; | 2357 return NULL; |
2356 return context.release(); | 2358 return context.release(); |
2357 } | 2359 } |
2358 | 2360 |
2359 } // namespace content | 2361 } // namespace content |
OLD | NEW |