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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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; | 608 attributes.depth = false; |
609 attributes.stencil = false; | 609 attributes.stencil = false; |
610 if (command_line.HasSwitch(cc::switches::kForceDirectLayerDrawing)) | |
611 attributes.stencil = true; | |
enne (OOO)
2013/05/16 20:34:11
This change is because of https://codereview.chrom
| |
610 WebGraphicsContext3DCommandBufferImpl* context = | 612 WebGraphicsContext3DCommandBufferImpl* context = |
611 CreateGraphicsContext3D(attributes); | 613 CreateGraphicsContext3D(attributes); |
612 if (!context) | 614 if (!context) |
613 return scoped_ptr<cc::OutputSurface>(); | 615 return scoped_ptr<cc::OutputSurface>(); |
614 | 616 |
615 bool composite_to_mailbox = | 617 bool composite_to_mailbox = |
616 command_line.HasSwitch(cc::switches::kCompositeToMailbox) && | 618 command_line.HasSwitch(cc::switches::kCompositeToMailbox) && |
617 !command_line.HasSwitch(switches::kEnableDelegatedRenderer); | 619 !command_line.HasSwitch(switches::kEnableDelegatedRenderer); |
618 // No swap throttling yet when compositing on the main thread. | 620 // No swap throttling yet when compositing on the main thread. |
619 DCHECK(!composite_to_mailbox || is_threaded_compositing_enabled_); | 621 DCHECK(!composite_to_mailbox || is_threaded_compositing_enabled_); |
(...skipping 1730 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 |