| Index: ui/gfx/render_text_win.cc
|
| ===================================================================
|
| --- ui/gfx/render_text_win.cc (revision 120360)
|
| +++ ui/gfx/render_text_win.cc (working copy)
|
| @@ -11,7 +11,7 @@
|
| #include "base/stl_util.h"
|
| #include "base/string_util.h"
|
| #include "base/utf_string_conversions.h"
|
| -#include "base/win/scoped_hdc.h"
|
| +#include "ui/gfx/screen_compatible_dc_win.h"
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/gfx/canvas_skia.h"
|
| #include "ui/gfx/platform_font.h"
|
| @@ -595,7 +595,7 @@
|
|
|
| void RenderTextWin::LayoutVisualText() {
|
| HRESULT hr = E_FAIL;
|
| - base::win::ScopedCreateDC hdc(CreateCompatibleDC(NULL));
|
| + ScopedTemporaryScreenCompatibleDC hdc;
|
| std::vector<internal::TextRun*>::const_iterator run_iter;
|
| for (run_iter = runs_.begin(); run_iter < runs_.end(); ++run_iter) {
|
| internal::TextRun* run = *run_iter;
|
| @@ -604,7 +604,7 @@
|
| bool tried_fallback = false;
|
|
|
| // Select the font desired for glyph generation.
|
| - SelectObject(hdc, run->font.GetNativeFont());
|
| + SelectObject(hdc.get(), run->font.GetNativeFont());
|
|
|
| run->logical_clusters.reset(new WORD[run_length]);
|
| run->glyph_count = 0;
|
| @@ -613,7 +613,7 @@
|
| while (max_glyphs < kMaxGlyphs) {
|
| run->glyphs.reset(new WORD[max_glyphs]);
|
| run->visible_attributes.reset(new SCRIPT_VISATTR[max_glyphs]);
|
| - hr = ScriptShape(hdc,
|
| + hr = ScriptShape(hdc.get(),
|
| &run->script_cache,
|
| run_text,
|
| run_length,
|
| @@ -644,10 +644,10 @@
|
|
|
| // The run's font doesn't contain the required glyphs, use an alternate.
|
| // TODO(msw): support RenderText's font_list().
|
| - if (ChooseFallbackFont(hdc, run->font, run_text, run_length,
|
| + if (ChooseFallbackFont(hdc.get(), run->font, run_text, run_length,
|
| &run->font)) {
|
| ScriptFreeCache(&run->script_cache);
|
| - SelectObject(hdc, run->font.GetNativeFont());
|
| + SelectObject(hdc.get(), run->font.GetNativeFont());
|
| }
|
|
|
| tried_fallback = true;
|
| @@ -660,7 +660,7 @@
|
| if (run->glyph_count > 0) {
|
| run->advance_widths.reset(new int[run->glyph_count]);
|
| run->offsets.reset(new GOFFSET[run->glyph_count]);
|
| - hr = ScriptPlace(hdc,
|
| + hr = ScriptPlace(hdc.get(),
|
| &run->script_cache,
|
| run->glyphs.get(),
|
| run->glyph_count,
|
|
|