OLD | NEW |
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/renderer/renderer_main_platform_delegate.h" | 5 #include "content/renderer/renderer_main_platform_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 // Windows-only skia sandbox support | 35 // Windows-only skia sandbox support |
36 // These are used for GDI-path rendering. | 36 // These are used for GDI-path rendering. |
37 void SkiaPreCacheFont(const LOGFONT& logfont) { | 37 void SkiaPreCacheFont(const LOGFONT& logfont) { |
38 RenderThread* render_thread = RenderThread::Get(); | 38 RenderThread* render_thread = RenderThread::Get(); |
39 if (render_thread) { | 39 if (render_thread) { |
40 render_thread->PreCacheFont(logfont); | 40 render_thread->PreCacheFont(logfont); |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 void SkiaPreCacheFontCharacters(const LOGFONT& logfont, | |
45 const wchar_t* text, | |
46 unsigned int text_length) { | |
47 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); | |
48 if (render_thread_impl) { | |
49 render_thread_impl->PreCacheFontCharacters( | |
50 logfont, | |
51 base::string16(text, text_length)); | |
52 } | |
53 } | |
54 | |
55 void WarmupDirectWrite() { | 44 void WarmupDirectWrite() { |
56 // The objects used here are intentionally not freed as we want the Skia | 45 // The objects used here are intentionally not freed as we want the Skia |
57 // code to use these objects after warmup. | 46 // code to use these objects after warmup. |
58 SetDefaultSkiaFactory(GetPreSandboxWarmupFontMgr()); | 47 SetDefaultSkiaFactory(GetPreSandboxWarmupFontMgr()); |
59 | 48 |
60 // We need to warm up *some* font for DirectWrite. We also need to pass one | 49 // We need to warm up *some* font for DirectWrite. We also need to pass one |
61 // down for the CC HUD code, so use the same one here. Note that we don't use | 50 // down for the CC HUD code, so use the same one here. Note that we don't use |
62 // a monospace as would be nice in an attempt to avoid a small startup time | 51 // a monospace as would be nice in an attempt to avoid a small startup time |
63 // regression, see http://crbug.com/463613. | 52 // regression, see http://crbug.com/463613. |
64 skia::RefPtr<SkTypeface> hud_typeface = skia::AdoptRef( | 53 skia::RefPtr<SkTypeface> hud_typeface = skia::AdoptRef( |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 return false; | 116 return false; |
128 #endif | 117 #endif |
129 | 118 |
130 target_services->LowerToken(); | 119 target_services->LowerToken(); |
131 return true; | 120 return true; |
132 } | 121 } |
133 return false; | 122 return false; |
134 } | 123 } |
135 | 124 |
136 } // namespace content | 125 } // namespace content |
OLD | NEW |