WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-97696-20121119133536.patch (text/plain), 16.32 KB, created by
Mark Pilgrim (Google)
on 2012-11-19 10:38:07 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Mark Pilgrim (Google)
Created:
2012-11-19 10:38:07 PST
Size:
16.32 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 135175) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,34 @@ >+2012-11-19 Mark Pilgrim <pilgrim@chromium.org> >+ >+ [Chromium][Win] Remove ensureFontLoaded from PlatformSupport >+ https://bugs.webkit.org/show_bug.cgi?id=97696 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove ensureFontLoaded() from PlatformSupport and call it >+ directly instead. Part of a refactoring series; see tracking bug 82948. >+ >+ * platform/chromium/PlatformSupport.h: >+ (PlatformSupport): >+ * platform/graphics/chromium/FontCacheChromiumWin.cpp: >+ (WebCore::fontContainsCharacter): >+ * platform/graphics/chromium/FontChromiumWin.cpp: >+ (WebCore::drawGlyphsWin): >+ * platform/graphics/chromium/FontPlatformDataChromiumWin.cpp: >+ (WebCore::FontPlatformData::scriptFontProperties): >+ * platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp: >+ (WebCore::getGlyphIndices): >+ (WebCore::fillBMPGlyphs): >+ * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp: >+ (WebCore::SimpleFontData::platformInit): >+ (WebCore::SimpleFontData::determinePitch): >+ (WebCore::SimpleFontData::platformBoundsForGlyph): >+ (WebCore::SimpleFontData::platformWidthForGlyph): >+ * platform/graphics/chromium/UniscribeHelperTextRun.cpp: >+ (WebCore::UniscribeHelperTextRun::tryToPreloadFont): >+ * platform/graphics/skia/SkiaFontWin.cpp: >+ (WebCore::paintSkiaText): >+ > 2012-11-19 Erik Arvidsson <arv@chromium.org> > > Update DOMException name: InvalidNodeTypeError >Index: Source/WebCore/platform/chromium/PlatformSupport.h >=================================================================== >--- Source/WebCore/platform/chromium/PlatformSupport.h (revision 135141) >+++ Source/WebCore/platform/chromium/PlatformSupport.h (working copy) >@@ -49,10 +49,6 @@ typedef struct NPObject NPObject; > typedef struct _NPP NPP_t; > typedef NPP_t* NPP; > >-#if OS(WINDOWS) >-typedef struct HFONT__* HFONT; >-#endif >- > namespace WebCore { > > class Color; >@@ -77,11 +73,6 @@ struct FontRenderStyle; > > class PlatformSupport { > public: >- // Font --------------------------------------------------------------- >-#if OS(WINDOWS) >- static bool ensureFontLoaded(HFONT); >-#endif >- > // IndexedDB ---------------------------------------------------------- > static PassRefPtr<IDBFactoryBackendInterface> idbFactory(); > >Index: Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp >=================================================================== >--- Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp (revision 135141) >+++ Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp (working copy) >@@ -36,8 +36,9 @@ > #include "FontUtilsChromiumWin.h" > #include "HWndDC.h" > #include "LayoutTestSupport.h" >-#include "PlatformSupport.h" > #include "SimpleFontData.h" >+#include <public/Platform.h> >+#include <public/win/WebSandboxSupport.h> > #include <unicode/uniset.h> > #include <wtf/HashMap.h> > #include <wtf/HashSet.h> >@@ -283,8 +284,14 @@ static bool fontContainsCharacter(const > HWndDC hdc(0); > HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(hdc, hfont)); > int count = GetFontUnicodeRanges(hdc, 0); >- if (!count && PlatformSupport::ensureFontLoaded(hfont)) >- count = GetFontUnicodeRanges(hdc, 0); >+ if (!count) { >+ bool fontLoaded = true; >+ WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport(); >+ if (sandboxSupport) >+ fontLoaded = sandboxSupport->ensureFontLoaded(hfont); >+ if (fontLoaded) >+ count = GetFontUnicodeRanges(hdc, 0); >+ } > if (!count) { > LOG_ERROR("Unable to get the font unicode range after second attempt"); > SelectObject(hdc, oldFont); >Index: Source/WebCore/platform/graphics/chromium/FontChromiumWin.cpp >=================================================================== >--- Source/WebCore/platform/graphics/chromium/FontChromiumWin.cpp (revision 135141) >+++ Source/WebCore/platform/graphics/chromium/FontChromiumWin.cpp (working copy) >@@ -35,7 +35,6 @@ > #include "FontFallbackList.h" > #include "GlyphBuffer.h" > #include "NotImplemented.h" >-#include "PlatformSupport.h" > #include "PlatformContextSkia.h" > #include "SimpleFontData.h" > #include "SkiaFontWin.h" >@@ -46,6 +45,8 @@ > #include "skia/ext/skia_utils_win.h" > #endif > >+#include <public/Platform.h> >+#include <public/win/WebSandboxSupport.h> > #include <windows.h> > > using namespace std; >@@ -527,7 +528,9 @@ static void drawGlyphsWin(GraphicsContex > success = painter.drawGlyphs(curLen, &glyphs[0], &advances[0], horizontalOffset - point.x() - currentWidth); > if (!success && !executions) { > // Ask the browser to load the font for us and retry. >- PlatformSupport::ensureFontLoaded(font->platformData().hfont()); >+ WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport(); >+ if (sandboxSupport) >+ fontLoaded = sandboxSupport->ensureFontLoaded(font->platformData().hfont()); > continue; > } > break; >Index: Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp >=================================================================== >--- Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp (revision 135141) >+++ Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp (working copy) >@@ -34,13 +34,13 @@ > > #include "FontCache.h" > #include "HWndDC.h" >-#include "PlatformSupport.h" > #include "SharedBuffer.h" > #include "SkTypeface_win.h" > #include "SkiaFontWin.h" >- > #include <mlang.h> > #include <objidl.h> >+#include <public/Platform.h> >+#include <public/win/WebSandboxSupport.h> > #include <windows.h> > #include <wtf/StdLibExtras.h> > >@@ -175,7 +175,11 @@ SCRIPT_FONTPROPERTIES* FontPlatformData: > HRESULT hr = ScriptGetFontProperties(dc, scriptCache(), > m_scriptFontProperties); > if (S_OK != hr) { >- if (PlatformSupport::ensureFontLoaded(hfont())) { >+ bool fontLoaded = true; >+ WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport(); >+ if (sandboxSupport) >+ fontLoaded = sandboxSupport->ensureFontLoaded(hfont()); >+ if (fontLoaded) { > // FIXME: Handle gracefully the error if this call also fails. > hr = ScriptGetFontProperties(dc, scriptCache(), > m_scriptFontProperties); >Index: Source/WebCore/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp >=================================================================== >--- Source/WebCore/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp (revision 135141) >+++ Source/WebCore/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp (working copy) >@@ -35,10 +35,11 @@ > #include "Font.h" > #include "GlyphPageTreeNode.h" > #include "HWndDC.h" >-#include "PlatformSupport.h" > #include "SimpleFontData.h" > #include "SystemInfo.h" > #include "UniscribeHelperTextRun.h" >+#include <public/Platform.h> >+#include <public/win/WebSandboxSupport.h> > > namespace WebCore { > >@@ -56,7 +57,11 @@ static bool getGlyphIndices(HFONT font, > { > if (GetGlyphIndices(dc, characters, charactersLength, glyphBuffer, flag) != GDI_ERROR) > return true; >- if (PlatformSupport::ensureFontLoaded(font)) { >+ bool fontLoaded = true; >+ WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport(); >+ if (sandboxSupport) >+ fontLoaded = sandboxSupport->ensureFontLoaded(font); >+ if (fontLoaded) { > if (GetGlyphIndices(dc, characters, charactersLength, glyphBuffer, flag) != GDI_ERROR) > return true; > // FIXME: Handle gracefully the error if this call also fails. >@@ -88,7 +93,11 @@ static bool fillBMPGlyphs(unsigned offse > > TEXTMETRIC tm = {0}; > if (!GetTextMetrics(dc, &tm)) { >- if (PlatformSupport::ensureFontLoaded(fontData->platformData().hfont())) { >+ bool fontLoaded = true; >+ WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport(); >+ if (sandboxSupport) >+ fontLoaded = sandboxSupport->ensureFontLoaded(fontData->platformData().hfont()); >+ if (fontLoaded) { > if (!GetTextMetrics(dc, &tm)) { > // FIXME: Handle gracefully the error if this call also fails. > // See http://crbug.com/6401 >Index: Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp >=================================================================== >--- Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp (revision 135141) >+++ Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp (working copy) >@@ -37,13 +37,13 @@ > #include "FontCache.h" > #include "FontDescription.h" > #include "HWndDC.h" >-#include "PlatformSupport.h" >-#include <wtf/MathExtras.h> >- >+#include <mlang.h> >+#include <objidl.h> >+#include <public/Platform.h> >+#include <public/win/WebSandboxSupport.h> > #include <unicode/uchar.h> > #include <unicode/unorm.h> >-#include <objidl.h> >-#include <mlang.h> >+#include <wtf/MathExtras.h> > > namespace WebCore { > >@@ -61,7 +61,11 @@ void SimpleFontData::platformInit() > > TEXTMETRIC textMetric = {0}; > if (!GetTextMetrics(dc, &textMetric)) { >- if (PlatformSupport::ensureFontLoaded(m_platformData.hfont())) { >+ bool fontLoaded = true; >+ WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport(); >+ if (sandboxSupport) >+ fontLoaded = sandboxSupport->ensureFontLoaded(m_platformData.hfont()); >+ if (fontLoaded) { > // Retry GetTextMetrics. > // FIXME: Handle gracefully the error if this call also fails. > // See http://crbug.com/6401. >@@ -136,7 +140,11 @@ void SimpleFontData::determinePitch() > // is *not* fixed pitch. Unbelievable but true. > TEXTMETRIC textMetric = {0}; > if (!GetTextMetrics(dc, &textMetric)) { >- if (PlatformSupport::ensureFontLoaded(m_platformData.hfont())) { >+ bool fontLoaded = true; >+ WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport(); >+ if (sandboxSupport) >+ fontLoaded = sandboxSupport->ensureFontLoaded(m_platformData.hfont()); >+ if (fontLoaded) { > // Retry GetTextMetrics. > // FIXME: Handle gracefully the error if this call also fails. > // See http://crbug.com/6401. >@@ -159,7 +167,11 @@ FloatRect SimpleFontData::platformBounds > GLYPHMETRICS gdiMetrics; > static const MAT2 identity = { 0, 1, 0, 0, 0, 0, 0, 1 }; > if (GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity) == -1) { >- if (PlatformSupport::ensureFontLoaded(m_platformData.hfont())) { >+ bool fontLoaded = true; >+ WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport(); >+ if (sandboxSupport) >+ fontLoaded = sandboxSupport->ensureFontLoaded(m_platformData.hfont()); >+ if (fontLoaded) { > // Retry GetTextMetrics. > // FIXME: Handle gracefully the error if this call also fails. > // See http://crbug.com/6401. >@@ -185,7 +197,11 @@ float SimpleFontData::platformWidthForGl > int width = 0; > if (!GetCharWidthI(dc, glyph, 1, 0, &width)) { > // Ask the browser to preload the font and retry. >- if (PlatformSupport::ensureFontLoaded(m_platformData.hfont())) { >+ bool fontLoaded = true; >+ WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport(); >+ if (sandboxSupport) >+ fontLoaded = sandboxSupport->ensureFontLoaded(m_platformData.hfont()); >+ if (fontLoaded) { > // FIXME: Handle gracefully the error if this call also fails. > // See http://crbug.com/6401. > if (!GetCharWidthI(dc, glyph, 1, 0, &width)) >Index: Source/WebCore/platform/graphics/chromium/UniscribeHelperTextRun.cpp >=================================================================== >--- Source/WebCore/platform/graphics/chromium/UniscribeHelperTextRun.cpp (revision 135141) >+++ Source/WebCore/platform/graphics/chromium/UniscribeHelperTextRun.cpp (working copy) >@@ -32,9 +32,10 @@ > #include "UniscribeHelperTextRun.h" > > #include "Font.h" >-#include "PlatformSupport.h" > #include "SimpleFontData.h" > #include "TextRun.h" >+#include <public/Platform.h> >+#include <public/win/WebSandboxSupport.h> > > namespace WebCore { > >@@ -82,7 +83,9 @@ void UniscribeHelperTextRun::tryToPreloa > // Ask the browser to get the font metrics for this font. > // That will preload the font and it should now be accessible > // from the renderer. >- PlatformSupport::ensureFontLoaded(font); >+ WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport(); >+ if (sandboxSupport) >+ sandboxSupport->ensureFontLoaded(font); > } > > bool UniscribeHelperTextRun::nextWinFontData( >Index: Source/WebCore/platform/graphics/skia/SkiaFontWin.cpp >=================================================================== >--- Source/WebCore/platform/graphics/skia/SkiaFontWin.cpp (revision 135141) >+++ Source/WebCore/platform/graphics/skia/SkiaFontWin.cpp (working copy) >@@ -35,13 +35,14 @@ > #include "Gradient.h" > #include "Pattern.h" > #include "PlatformContextSkia.h" >-#include "PlatformSupport.h" > #include "SimpleFontData.h" > #include "SkCanvas.h" > #include "SkDevice.h" > #include "SkPaint.h" > #include "SkShader.h" > #include "SkTemplates.h" >+#include <public/Platform.h> >+#include <public/win/WebSandboxSupport.h> > > namespace WebCore { > >@@ -221,8 +222,13 @@ static void paintSkiaText(GraphicsContex > SkCanvas* canvas = platformContext->canvas(); > TextDrawingModeFlags textMode = platformContext->getTextDrawingMode(); > // Ensure font load for printing, because PDF device needs it. >- if (canvas->getTopDevice()->getDeviceCapabilities() & SkDevice::kVector_Capability) >- PlatformSupport::ensureFontLoaded(hfont); >+ if (canvas->getTopDevice()->getDeviceCapabilities() & SkDevice::kVector_Capability) { >+ WebKit::WebSandboxSupport* sandboxSupport = WebKit::Platform::current()->sandboxSupport(); >+ // if there is no sandbox, then we can assume the font >+ // was able to be loaded successfully already >+ if (sandboxSupport) >+ sandboxSupport->ensureFontLoaded(font); >+ } > > // Filling (if necessary). This is the common case. > SkPaint paint; >Index: Source/WebKit/chromium/ChangeLog >=================================================================== >--- Source/WebKit/chromium/ChangeLog (revision 135175) >+++ Source/WebKit/chromium/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2012-11-19 Mark Pilgrim <pilgrim@chromium.org> >+ >+ [Chromium][Win] Remove ensureFontLoaded from PlatformSupport >+ https://bugs.webkit.org/show_bug.cgi?id=97696 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove ensureFontLoaded() from PlatformSupport and call it >+ directly instead. Part of a refactoring series; see tracking bug 82948. >+ >+ * src/PlatformSupport.cpp: >+ (WebCore): >+ > 2012-11-19 Vincent Scheib <scheib@chromium.org> > > [Chromium] Remove WebKit::WebRuntimeFeatures::enablePointerLock. >Index: Source/WebKit/chromium/src/PlatformSupport.cpp >=================================================================== >--- Source/WebKit/chromium/src/PlatformSupport.cpp (revision 135141) >+++ Source/WebKit/chromium/src/PlatformSupport.cpp (working copy) >@@ -104,19 +104,6 @@ using namespace WebKit; > > namespace WebCore { > >-// Font ----------------------------------------------------------------------- >- >-#if OS(WINDOWS) >-bool PlatformSupport::ensureFontLoaded(HFONT font) >-{ >- WebSandboxSupport* ss = WebKit::Platform::current()->sandboxSupport(); >- >- // if there is no sandbox, then we can assume the font >- // was able to be loaded successfully already >- return ss ? ss->ensureFontLoaded(font) : true; >-} >-#endif >- > // Indexed Database ----------------------------------------------------------- > > PassRefPtr<IDBFactoryBackendInterface> PlatformSupport::idbFactory()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 97696
:
165828
|
175004
|
176516
|
176564