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

Unified Diff: ui/gfx/win/direct_write.cc

Issue 1514183002: Revert "Create direct write font proxy classes and unit tests." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/win/direct_write.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/win/direct_write.cc
diff --git a/ui/gfx/win/direct_write.cc b/ui/gfx/win/direct_write.cc
index 9c8250b5bbf5175e7e339e7b72fbae5cfd550ecd..38c926a9bd11da661c3e66b614c177427a6bf6ae 100644
--- a/ui/gfx/win/direct_write.cc
+++ b/ui/gfx/win/direct_write.cc
@@ -4,6 +4,8 @@
#include "ui/gfx/win/direct_write.h"
+#include <dwrite.h>
+
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/metrics/field_trial.h"
@@ -55,7 +57,12 @@ bool ShouldUseDirectWrite() {
return group_name != "Disabled";
}
-void CreateDWriteFactory(IDWriteFactory** factory) {
+void MaybeInitializeDirectWrite() {
+ static bool tried_dwrite_initialize = false;
+ if (tried_dwrite_initialize)
+ return;
+ tried_dwrite_initialize = true;
+
if (!ShouldUseDirectWrite() ||
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableDirectWriteForUI)) {
@@ -74,26 +81,13 @@ void CreateDWriteFactory(IDWriteFactory** factory) {
if (!dwrite_create_factory_proc)
return;
- // Failure to create the DirectWrite factory indicates a corrupt dll.
- base::win::ScopedComPtr<IUnknown> factory_unknown;
- if (FAILED(dwrite_create_factory_proc(DWRITE_FACTORY_TYPE_SHARED,
- __uuidof(IDWriteFactory),
- factory_unknown.Receive()))) {
- return;
- }
- factory_unknown.QueryInterface<IDWriteFactory>(factory);
-}
-
-void MaybeInitializeDirectWrite() {
- static bool tried_dwrite_initialize = false;
- if (tried_dwrite_initialize)
- return;
- tried_dwrite_initialize = true;
-
base::win::ScopedComPtr<IDWriteFactory> factory;
- CreateDWriteFactory(factory.Receive());
- if (factory == nullptr)
+ // Failure to create the DirectWrite factory indicates a corrupt dll.
+ if (FAILED(dwrite_create_factory_proc(
+ DWRITE_FACTORY_TYPE_SHARED,
+ __uuidof(IDWriteFactory),
+ reinterpret_cast<IUnknown**>(factory.Receive()))))
return;
// The skia call to create a new DirectWrite font manager instance can fail
« no previous file with comments | « ui/gfx/win/direct_write.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698