Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 11953054: Fix high-DPI on Windows to make use of DIP scaling in WebKit. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove redundant comments. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 command_line.HasSwitch(switches::kEnableAcceleratedScrollableFrames); 490 command_line.HasSwitch(switches::kEnableAcceleratedScrollableFrames);
491 prefs.composited_scrolling_for_frames_enabled = 491 prefs.composited_scrolling_for_frames_enabled =
492 command_line.HasSwitch(switches::kEnableCompositedScrollingForFrames); 492 command_line.HasSwitch(switches::kEnableCompositedScrollingForFrames);
493 prefs.show_paint_rects = 493 prefs.show_paint_rects =
494 command_line.HasSwitch(switches::kShowPaintRects); 494 command_line.HasSwitch(switches::kShowPaintRects);
495 prefs.render_vsync_enabled = 495 prefs.render_vsync_enabled =
496 !command_line.HasSwitch(switches::kDisableGpuVsync); 496 !command_line.HasSwitch(switches::kDisableGpuVsync);
497 prefs.accelerated_compositing_enabled = 497 prefs.accelerated_compositing_enabled =
498 GpuProcessHost::gpu_enabled() && 498 GpuProcessHost::gpu_enabled() &&
499 !command_line.HasSwitch(switches::kDisableAcceleratedCompositing); 499 !command_line.HasSwitch(switches::kDisableAcceleratedCompositing);
500 #if defined(OS_WIN) && defined(ENABLE_HIDPI)
501 prefs.force_compositing_mode = true;
502 #else
500 prefs.force_compositing_mode = 503 prefs.force_compositing_mode =
501 content::IsForceCompositingModeEnabled() && 504 content::IsForceCompositingModeEnabled() &&
502 !command_line.HasSwitch(switches::kDisableForceCompositingMode); 505 !command_line.HasSwitch(switches::kDisableForceCompositingMode);
506 #endif
503 prefs.fixed_position_compositing_enabled = 507 prefs.fixed_position_compositing_enabled =
504 command_line.HasSwitch(switches::kEnableCompositingForFixedPosition); 508 command_line.HasSwitch(switches::kEnableCompositingForFixedPosition);
505 prefs.accelerated_2d_canvas_enabled = 509 prefs.accelerated_2d_canvas_enabled =
506 GpuProcessHost::gpu_enabled() && 510 GpuProcessHost::gpu_enabled() &&
507 !command_line.HasSwitch(switches::kDisableAccelerated2dCanvas); 511 !command_line.HasSwitch(switches::kDisableAccelerated2dCanvas);
508 prefs.deferred_2d_canvas_enabled = 512 prefs.deferred_2d_canvas_enabled =
509 !command_line.HasSwitch(switches::kDisableDeferred2dCanvas); 513 !command_line.HasSwitch(switches::kDisableDeferred2dCanvas);
510 prefs.antialiased_2d_canvas_disabled = 514 prefs.antialiased_2d_canvas_disabled =
511 command_line.HasSwitch(switches::kDisable2dCanvasAntialiasing); 515 command_line.HasSwitch(switches::kDisable2dCanvasAntialiasing);
512 prefs.accelerated_painting_enabled = 516 prefs.accelerated_painting_enabled =
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 } 618 }
615 619
616 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( 620 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
617 rvh->GetProcess()->GetID())) { 621 rvh->GetProcess()->GetID())) {
618 prefs.loads_images_automatically = true; 622 prefs.loads_images_automatically = true;
619 prefs.javascript_enabled = true; 623 prefs.javascript_enabled = true;
620 } 624 }
621 625
622 prefs.is_online = !net::NetworkChangeNotifier::IsOffline(); 626 prefs.is_online = !net::NetworkChangeNotifier::IsOffline();
623 627
628 #if defined(OS_WIN) && defined(ENABLE_HIDPI)
629 prefs.accelerated_compositing_enabled = true;
630 prefs.accelerated_2d_canvas_enabled = true;
631 #else
624 // Force accelerated compositing and 2d canvas off for chrome: and about: 632 // Force accelerated compositing and 2d canvas off for chrome: and about:
625 // pages (unless it's specifically allowed). 633 // pages (unless it's specifically allowed).
626 if ((url.SchemeIs(chrome::kChromeUIScheme) || 634 if ((url.SchemeIs(chrome::kChromeUIScheme) ||
627 (url.SchemeIs(chrome::kAboutScheme) && 635 (url.SchemeIs(chrome::kAboutScheme) &&
628 url.spec() != chrome::kAboutBlankURL)) && 636 url.spec() != chrome::kAboutBlankURL)) &&
629 !command_line.HasSwitch(switches::kAllowWebUICompositing)) { 637 !command_line.HasSwitch(switches::kAllowWebUICompositing)) {
630 prefs.accelerated_compositing_enabled = false; 638 prefs.accelerated_compositing_enabled = false;
631 prefs.accelerated_2d_canvas_enabled = false; 639 prefs.accelerated_2d_canvas_enabled = false;
632 } 640 }
641 #endif
633 642
634 if (url.SchemeIs(chrome::kChromeDevToolsScheme)) 643 if (url.SchemeIs(chrome::kChromeDevToolsScheme))
635 prefs.show_fps_counter = false; 644 prefs.show_fps_counter = false;
636 645
637 if (command_line.HasSwitch(switches::kDefaultTileWidth)) 646 if (command_line.HasSwitch(switches::kDefaultTileWidth))
638 prefs.default_tile_width = 647 prefs.default_tile_width =
639 GetSwitchValueAsInt(command_line, switches::kDefaultTileWidth, 1); 648 GetSwitchValueAsInt(command_line, switches::kDefaultTileWidth, 1);
640 if (command_line.HasSwitch(switches::kDefaultTileHeight)) 649 if (command_line.HasSwitch(switches::kDefaultTileHeight))
641 prefs.default_tile_height = 650 prefs.default_tile_height =
642 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1); 651 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1);
(...skipping 2806 matching lines...) Expand 10 before | Expand all | Expand 10 after
3449 3458
3450 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { 3459 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() {
3451 return browser_plugin_guest_.get(); 3460 return browser_plugin_guest_.get();
3452 } 3461 }
3453 3462
3454 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { 3463 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() {
3455 return browser_plugin_embedder_.get(); 3464 return browser_plugin_embedder_.get();
3456 } 3465 }
3457 3466
3458 } // namespace content 3467 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/test_render_view_host.h ('k') | content/port/browser/render_widget_host_view_port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698