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

Side by Side Diff: content/common/sandbox_win.cc

Issue 342353003: Don't use DirectWrite if smoothing or ClearType is off (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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/common/sandbox_win.h" 5 #include "content/common/sandbox_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 583 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
584 if (command_line.HasSwitch(switches::kDisableDirectWrite)) 584 if (command_line.HasSwitch(switches::kDisableDirectWrite))
585 return false; 585 return false;
586 586
587 #if !defined(NACL_WIN64) 587 #if !defined(NACL_WIN64)
588 // Can't use GDI on HiDPI. 588 // Can't use GDI on HiDPI.
589 if (gfx::GetDPIScale() > 1.0f) 589 if (gfx::GetDPIScale() > 1.0f)
590 return true; 590 return true;
591 #endif 591 #endif
592 592
593 // If anti-aliasing or ClearType are off, don't use DirectWrite.
594 BOOL smoothing = FALSE;
595 SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &smoothing, 0);
596 if (!smoothing)
597 return false;
598 UINT smooth_type = 0;
599 SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smooth_type, 0);
600 if (smooth_type != FE_FONTSMOOTHINGCLEARTYPE)
601 return false;
602
593 // Otherwise, check the field trial. 603 // Otherwise, check the field trial.
594 const std::string group_name = 604 const std::string group_name =
595 base::FieldTrialList::FindFullName("DirectWrite"); 605 base::FieldTrialList::FindFullName("DirectWrite");
596 return group_name != "Disabled"; 606 return group_name != "Disabled";
597 } 607 }
598 608
599 base::ProcessHandle StartSandboxedProcess( 609 base::ProcessHandle StartSandboxedProcess(
600 SandboxedProcessLauncherDelegate* delegate, 610 SandboxedProcessLauncherDelegate* delegate,
601 CommandLine* cmd_line) { 611 CommandLine* cmd_line) {
602 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); 612 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 } 784 }
775 785
776 return false; 786 return false;
777 } 787 }
778 788
779 bool BrokerAddTargetPeer(HANDLE peer_process) { 789 bool BrokerAddTargetPeer(HANDLE peer_process) {
780 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; 790 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK;
781 } 791 }
782 792
783 } // namespace content 793 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698