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

Unified Diff: content/renderer/renderer_main_platform_delegate_win.cc

Issue 1378353006: Implementation of dwrite font proxy and removal of dwrite font cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More codereview fixes. Jumped the gun on previous patchset. Created 5 years, 1 month 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 | « content/renderer/dwrite_font_proxy_init_win.cc ('k') | content/test/dwrite_font_fake_sender_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_main_platform_delegate_win.cc
diff --git a/content/renderer/renderer_main_platform_delegate_win.cc b/content/renderer/renderer_main_platform_delegate_win.cc
index aae8ea1e0b2e8906195d9bb6d804361ffddc12f7..1b62830aed1efdefabf25ec11f0efe9fdde5c6c6 100644
--- a/content/renderer/renderer_main_platform_delegate_win.cc
+++ b/content/renderer/renderer_main_platform_delegate_win.cc
@@ -4,6 +4,8 @@
#include "content/renderer/renderer_main_platform_delegate.h"
+#include <dwrite.h>
+
#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -11,7 +13,7 @@
#include "base/win/scoped_comptr.h"
#include "base/win/win_util.h"
#include "base/win/windows_version.h"
-#include "content/common/font_warmup_win.h"
+#include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/injection_test_win.h"
#include "content/public/renderer/render_thread.h"
@@ -24,8 +26,6 @@
#include "ui/gfx/win/direct_write.h"
#include "ui/gfx/win/dpi.h"
-#include <dwrite.h>
-
namespace content {
namespace {
@@ -49,6 +49,11 @@ RendererMainPlatformDelegate::RendererMainPlatformDelegate(
RendererMainPlatformDelegate::~RendererMainPlatformDelegate() {
}
+// Helper function to cast RenderThred to IPC::Sender so we can Bind() it.
+IPC::Sender* RenderThreadGetAsSender() {
+ return RenderThread::Get();
+}
+
void RendererMainPlatformDelegate::PlatformInitialize() {
const base::CommandLine& command_line = parameters_.command_line;
@@ -67,7 +72,7 @@ void RendererMainPlatformDelegate::PlatformInitialize() {
scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault());
if (use_direct_write) {
- WarmupDirectWrite();
+ InitializeDWriteFontProxy(base::Bind(&RenderThreadGetAsSender));
} else {
SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont);
}
@@ -77,6 +82,7 @@ void RendererMainPlatformDelegate::PlatformInitialize() {
}
void RendererMainPlatformDelegate::PlatformUninitialize() {
+ UninitializeDWriteFontProxy();
}
bool RendererMainPlatformDelegate::EnableSandbox() {
« no previous file with comments | « content/renderer/dwrite_font_proxy_init_win.cc ('k') | content/test/dwrite_font_fake_sender_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698