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

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

Issue 12226127: Fix backing store scrolling on Windows in high-DPI mode. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
503 prefs.force_compositing_mode = 500 prefs.force_compositing_mode =
504 content::IsForceCompositingModeEnabled() && 501 content::IsForceCompositingModeEnabled() &&
505 !command_line.HasSwitch(switches::kDisableForceCompositingMode); 502 !command_line.HasSwitch(switches::kDisableForceCompositingMode);
506 #endif
507 prefs.accelerated_2d_canvas_enabled = 503 prefs.accelerated_2d_canvas_enabled =
508 GpuProcessHost::gpu_enabled() && 504 GpuProcessHost::gpu_enabled() &&
509 !command_line.HasSwitch(switches::kDisableAccelerated2dCanvas); 505 !command_line.HasSwitch(switches::kDisableAccelerated2dCanvas);
510 prefs.deferred_2d_canvas_enabled = 506 prefs.deferred_2d_canvas_enabled =
511 !command_line.HasSwitch(switches::kDisableDeferred2dCanvas); 507 !command_line.HasSwitch(switches::kDisableDeferred2dCanvas);
512 prefs.antialiased_2d_canvas_disabled = 508 prefs.antialiased_2d_canvas_disabled =
513 command_line.HasSwitch(switches::kDisable2dCanvasAntialiasing); 509 command_line.HasSwitch(switches::kDisable2dCanvasAntialiasing);
514 prefs.accelerated_painting_enabled = 510 prefs.accelerated_painting_enabled =
515 GpuProcessHost::gpu_enabled() && 511 GpuProcessHost::gpu_enabled() &&
516 command_line.HasSwitch(switches::kEnableAcceleratedPainting); 512 command_line.HasSwitch(switches::kEnableAcceleratedPainting);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 } 609 }
614 610
615 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( 611 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
616 rvh->GetProcess()->GetID())) { 612 rvh->GetProcess()->GetID())) {
617 prefs.loads_images_automatically = true; 613 prefs.loads_images_automatically = true;
618 prefs.javascript_enabled = true; 614 prefs.javascript_enabled = true;
619 } 615 }
620 616
621 prefs.is_online = !net::NetworkChangeNotifier::IsOffline(); 617 prefs.is_online = !net::NetworkChangeNotifier::IsOffline();
622 618
623 #if defined(OS_WIN) && defined(ENABLE_HIDPI)
624 prefs.accelerated_compositing_enabled = true;
625 prefs.accelerated_2d_canvas_enabled = true;
626 #else
627 // Force accelerated compositing and 2d canvas off for chrome: and about: 619 // Force accelerated compositing and 2d canvas off for chrome: and about:
628 // pages (unless it's specifically allowed). 620 // pages (unless it's specifically allowed).
629 if ((url.SchemeIs(chrome::kChromeUIScheme) || 621 if ((url.SchemeIs(chrome::kChromeUIScheme) ||
630 (url.SchemeIs(chrome::kAboutScheme) && 622 (url.SchemeIs(chrome::kAboutScheme) &&
631 url.spec() != chrome::kAboutBlankURL)) && 623 url.spec() != chrome::kAboutBlankURL)) &&
632 !command_line.HasSwitch(switches::kAllowWebUICompositing)) { 624 !command_line.HasSwitch(switches::kAllowWebUICompositing)) {
633 prefs.accelerated_compositing_enabled = false; 625 prefs.accelerated_compositing_enabled = false;
634 prefs.accelerated_2d_canvas_enabled = false; 626 prefs.accelerated_2d_canvas_enabled = false;
635 } 627 }
636 #endif
637 628
638 if (url.SchemeIs(chrome::kChromeDevToolsScheme)) 629 if (url.SchemeIs(chrome::kChromeDevToolsScheme))
639 prefs.show_fps_counter = false; 630 prefs.show_fps_counter = false;
640 631
641 if (command_line.HasSwitch(switches::kDefaultTileWidth)) 632 if (command_line.HasSwitch(switches::kDefaultTileWidth))
642 prefs.default_tile_width = 633 prefs.default_tile_width =
643 GetSwitchValueAsInt(command_line, switches::kDefaultTileWidth, 1); 634 GetSwitchValueAsInt(command_line, switches::kDefaultTileWidth, 1);
644 if (command_line.HasSwitch(switches::kDefaultTileHeight)) 635 if (command_line.HasSwitch(switches::kDefaultTileHeight))
645 prefs.default_tile_height = 636 prefs.default_tile_height =
646 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1); 637 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1);
(...skipping 2882 matching lines...) Expand 10 before | Expand all | Expand 10 after
3529 3520
3530 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { 3521 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const {
3531 return browser_plugin_guest_.get(); 3522 return browser_plugin_guest_.get();
3532 } 3523 }
3533 3524
3534 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { 3525 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const {
3535 return browser_plugin_embedder_.get(); 3526 return browser_plugin_embedder_.get();
3536 } 3527 }
3537 3528
3538 } // namespace content 3529 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698