diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-13 17:16:14 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-13 17:16:14 +0000 |
commit | dca408e49016c2bdf1fef64be587f6f2d3b81cf8 (patch) | |
tree | 61260f5d3c21f35262c9ff382f933dd375456b00 /webkit | |
parent | db8f44cb41f402a9145bace60f6097410f46881d (diff) | |
download | chromium_src-dca408e49016c2bdf1fef64be587f6f2d3b81cf8.zip chromium_src-dca408e49016c2bdf1fef64be587f6f2d3b81cf8.tar.gz chromium_src-dca408e49016c2bdf1fef64be587f6f2d3b81cf8.tar.bz2 |
Remove references to base from platform/graphics.
Review URL: http://codereview.chromium.org/13806
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
3 files changed, 25 insertions, 16 deletions
diff --git a/webkit/port/platform/graphics/chromium/FontCacheChromiumWin.cpp b/webkit/port/platform/graphics/chromium/FontCacheChromiumWin.cpp index 1f77343..779e3e3 100644 --- a/webkit/port/platform/graphics/chromium/FontCacheChromiumWin.cpp +++ b/webkit/port/platform/graphics/chromium/FontCacheChromiumWin.cpp @@ -331,9 +331,8 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length) { - // TODO(jungshik) : Consider passing fontDescription.dominantScript() - // to GetFallbackFamily here along with the corresponding change - // in base/gfx. + // TODO(jungshik) : Consider passing fontDescription.dominantScript() + // to GetFallbackFamily here. FontDescription fontDescription = font.fontDescription(); UChar32 c; UScriptCode script; @@ -349,8 +348,7 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, // Last resort font list : PanUnicode. CJK fonts have a pretty // large repertoire. Eventually, we need to scan all the fonts - // on the system to have a Firefox-like coverage and this needs - // to move to base/gfx. + // on the system to have a Firefox-like coverage. // Make sure that all of them are lowercased. const static wchar_t* const cjkFonts[] = { L"arial unicode ms", @@ -367,7 +365,6 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, // CJK Ext. B fonts are not listed here because it's of no use // with our current non-BMP character handling because we use // Uniscribe for it and that code path does not go through here. - // This will be fixed when we move a bulk of this to base/gfx. }; const static wchar_t* const commonFonts[] = { diff --git a/webkit/port/platform/graphics/chromium/FontPlatformDataLinux.cpp b/webkit/port/platform/graphics/chromium/FontPlatformDataLinux.cpp index a3d9dd0..01167da 100644 --- a/webkit/port/platform/graphics/chromium/FontPlatformDataLinux.cpp +++ b/webkit/port/platform/graphics/chromium/FontPlatformDataLinux.cpp @@ -91,8 +91,8 @@ unsigned FontPlatformData::hash() const h ^= 0x01010101 * (((int)m_fakeBold << 1) | (int)m_fakeItalic); // This memcpy is to avoid a reinterpret_cast that breaks strict-aliasing - // rules. See base/basictypes.h and its discussion of bit_cast for - // performance implications (briefly: doesn't matter). + // rules. Memcpy is generally optimized enough so that performance doesn't + // matter here. uint32_t textsize_bytes; memcpy(&textsize_bytes, &m_textSize, sizeof(uint32_t)); h ^= textsize_bytes; diff --git a/webkit/port/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp b/webkit/port/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp index 709ee58..78a421b 100644 --- a/webkit/port/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp +++ b/webkit/port/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp @@ -37,16 +37,30 @@ #include "SimpleFontData.h" #include "UniscribeHelperTextRun.h" -#include "base/win_util.h" - namespace WebCore { +static bool IsVistaOrGreater() +{ + // Cache the result to avoid asking every time. + static bool checkedVersion = false; + static bool isVistaOrGreater = false; + if (!checkedVersion) { + OSVERSIONINFO versionInfo; + versionInfo.dwOSVersionInfoSize = sizeof(versionInfo); + GetVersionEx(&versionInfo); + + checkedVersion = true; + isVistaOrGreater = versionInfo.dwMajorVersion >= 6; + } + return isVistaOrGreater; +} + // Fills one page of font data pointers with NULL to indicate that there // are no glyphs for the characters. static void FillEmptyGlyphs(GlyphPage* page) { for (int i = 0; i < GlyphPage::size; ++i) - page->setGlyphDataForIndex(i, NULL, NULL); + page->setGlyphDataForIndex(i, NULL, NULL); } // Lazily initializes space glyph @@ -58,7 +72,6 @@ static Glyph InitSpaceGlyph(HDC dc, Glyph* space_glyph) { return *space_glyph; } - // Fills a page of glyphs in the Basic Multilingual Plane (<= U+FFFF). We // can use the standard Windows GDI functions here. The input buffer size is // assumed to be GlyphPage::size. Returns true if any glyphs were found. @@ -132,8 +145,7 @@ static bool FillBMPGlyphs(UChar* buffer, // Copy the output to the GlyphPage bool have_glyphs = false; int invalid_glyph = 0xFFFF; - if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA && - !(tm.tmPitchAndFamily & TMPF_TRUETYPE)) + if (!IsVistaOrGreater() && !(tm.tmPitchAndFamily & TMPF_TRUETYPE)) invalid_glyph = 0x1F; Glyph space_glyph = 0; // Glyph for a space. Lazily filled. @@ -195,7 +207,7 @@ static bool FillNonBMPGlyphs(UChar* buffer, const SimpleFontData* fontData) { bool have_glyphs = false; - + UniscribeHelperTextRun state(buffer, GlyphPage::size * 2, false, fontData->m_font.hfont(), fontData->m_font.scriptCache(), @@ -240,4 +252,4 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* characterBuffer, u } } -} +} // namespace WebCore |