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-95363-20120829145442.patch (text/plain), 19.91 KB, created by
Mark Pilgrim (Google)
on 2012-08-29 11:55:16 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Mark Pilgrim (Google)
Created:
2012-08-29 11:55:16 PDT
Size:
19.91 KB
patch
obsolete
>Index: Source/Platform/ChangeLog >=================================================================== >--- Source/Platform/ChangeLog (revision 127026) >+++ Source/Platform/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2012-08-29 Mark Pilgrim <pilgrim@chromium.org> >+ >+ [Chromium] Remove getRenderStyleForStrike from PlatformSupport >+ https://bugs.webkit.org/show_bug.cgi?id=95363 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Part of a refactoring series. See tracking bug 82948. >+ >+ * Platform.gypi: >+ * chromium/public/linux/WebFontInfo.h: Added. >+ (WebKit): >+ (WebFontInfo): >+ * chromium/public/linux/WebFontRenderStyle.h: Added. >+ (WebKit): >+ > 2012-08-27 Ian Vollick <vollick@chromium.org> > > [chromium] Should accelerate rotations of >= 180 degrees >Index: Source/Platform/Platform.gypi >=================================================================== >--- Source/Platform/Platform.gypi (revision 127024) >+++ Source/Platform/Platform.gypi (working copy) >@@ -141,6 +141,8 @@ > 'chromium/public/WebWorkerRunLoop.h', > 'chromium/public/android/WebSandboxSupport.h', > 'chromium/public/android/WebThemeEngine.h', >+ 'chromium/public/linux/WebFontInfo.h', >+ 'chromium/public/linux/WebFontRenderStyle.h', > 'chromium/public/linux/WebSandboxSupport.h', > 'chromium/public/linux/WebThemeEngine.h', > 'chromium/public/mac/WebSandboxSupport.h', >Index: Source/Platform/chromium/public/linux/WebFontInfo.h >=================================================================== >--- Source/Platform/chromium/public/linux/WebFontInfo.h (revision 0) >+++ Source/Platform/chromium/public/linux/WebFontInfo.h (revision 0) >@@ -0,0 +1,78 @@ >+/* >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions are >+ * met: >+ * >+ * * Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * * Redistributions in binary form must reproduce the above >+ * copyright notice, this list of conditions and the following disclaimer >+ * in the documentation and/or other materials provided with the >+ * distribution. >+ * * Neither the name of Google Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from >+ * this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef WebFontInfo_h >+#define WebFontInfo_h >+ >+#include "../WebCString.h" >+#include "WebFontFamily.h" >+#include "WebFontRenderStyle.h" >+ >+#include <string.h> >+#include <unistd.h> >+ >+namespace WebKit { >+ >+class WebFontInfo { >+public: >+ // Set a global preference describing whether renderStyleForStrike() should >+ // enable subpixel positioning or not. FontConfig doesn't currently provide >+ // a parameter for controlling this. >+ WEBKIT_EXPORT static void setSubpixelPositioning(bool); >+ >+ // Return a font family which provides glyphs for the Unicode code points >+ // specified by |utf16| >+ // characters: a native-endian UTF16 string >+ // numCharacters: the number of 16-bit words in |utf16| >+ // preferredLocale: preferred locale identifier for the |characters| >+ // (e.g. "en", "ja", "zh-CN") >+ // >+ // Returns: the font family or an empty string if the request could not be >+ // satisfied. >+ // Returns: the font family instance. The instance has an empty font name if the request could not be satisfied. >+ WEBKIT_EXPORT static void familyForChars(const WebUChar* characters, size_t numCharacters, const char* preferredLocale, WebFontFamily*); >+ >+ // Fill out the given WebFontRenderStyle with the user's preferences for >+ // rendering the given font at the given size (in pixels). >+ // family: i.e. "Times New Roman" >+ // sizeAndStyle: >+ // 3322222222221111111111 >+ // 10987654321098765432109876543210 >+ // +--------------------------------+ >+ // |..............Size............IB| >+ // +--------------------------------+ >+ // I: italic flag >+ // B: bold flag >+ WEBKIT_EXPORT static void renderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle* result); >+}; >+ >+} // namespace WebKit >+ >+#endif >Index: Source/Platform/chromium/public/linux/WebFontRenderStyle.h >=================================================================== >--- Source/Platform/chromium/public/linux/WebFontRenderStyle.h (revision 0) >+++ Source/Platform/chromium/public/linux/WebFontRenderStyle.h (revision 0) >@@ -0,0 +1,63 @@ >+/* >+ * Copyright (C) 2010 Google Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions are >+ * met: >+ * >+ * * Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * * Redistributions in binary form must reproduce the above >+ * copyright notice, this list of conditions and the following disclaimer >+ * in the documentation and/or other materials provided with the >+ * distribution. >+ * * Neither the name of Google Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from >+ * this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef WebFontRenderStyle_h >+#define WebFontRenderStyle_h >+ >+#include "../WebCommon.h" >+ >+namespace WebCore { struct FontRenderStyle; } >+ >+namespace WebKit { >+ >+struct WEBKIT_EXPORT WebFontRenderStyle { >+ // Each of the use* members below can take one of three values: >+ // 0: off >+ // 1: on >+ // 2: no preference expressed >+ char useBitmaps; // use embedded bitmap strike if possible >+ char useAutoHint; // use 'auto' hinting (FreeType specific) >+ char useHinting; // hint glyphs to the pixel grid >+ char hintStyle; // level of hinting, 0..3 >+ char useAntiAlias; // antialias glyph shapes >+ char useSubpixelRendering; // use subpixel rendering (partially-filled pixels) >+ char useSubpixelPositioning; // use subpixel positioning (fractional X positions for glyphs) >+ >+#if WEBKIT_IMPLEMENTATION >+ // Translates the members of this struct to a FontRenderStyle >+ void toFontRenderStyle(WebCore::FontRenderStyle*); >+#endif >+ >+ void setDefaults(); >+}; >+ >+} // namespace WebKit >+ >+#endif // WebFontRenderStyle_h >Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 127026) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,22 @@ >+2012-08-29 Mark Pilgrim <pilgrim@chromium.org> >+ >+ [Chromium] Remove getRenderStyleForStrike from PlatformSupport >+ https://bugs.webkit.org/show_bug.cgi?id=95363 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Part of a refactoring series. See tracking bug 82948. >+ >+ * platform/chromium/PlatformSupport.h: >+ (PlatformSupport): >+ * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp: >+ (WebCore::FontPlatformData::operator==): >+ (WebCore::FontPlatformData::getRenderStyleForStrike): >+ (WebCore): >+ (WebCore::FontPlatformData::querySystemForRenderStyle): >+ * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h: >+ (FontPlatformData): >+ > 2012-08-28 Shawn Singh <shawnsingh@chromium.org> > > [chromium] Do not clip root layer's subtree to viewport >Index: Source/WebCore/platform/chromium/PlatformSupport.h >=================================================================== >--- Source/WebCore/platform/chromium/PlatformSupport.h (revision 127024) >+++ Source/WebCore/platform/chromium/PlatformSupport.h (working copy) >@@ -105,7 +105,6 @@ public: > #if OS(DARWIN) > static bool loadFont(NSFont* srcFont, CGFontRef*, uint32_t* fontID); > #elif OS(UNIX) >- static void getRenderStyleForStrike(const char* family, int sizeAndStyle, FontRenderStyle* result); > struct FontFamily { > String name; > bool isBold; >Index: Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp >=================================================================== >--- Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp (revision 127024) >+++ Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp (working copy) >@@ -1,10 +1,10 @@ > /* > * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. >- * >+ * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions are > * met: >- * >+ * > * * Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * * Redistributions in binary form must reproduce the above >@@ -14,7 +14,7 @@ > * * Neither the name of Google Inc. nor the names of its > * contributors may be used to endorse or promote products derived from > * this software without specific prior written permission. >- * >+ * > * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >@@ -29,25 +29,27 @@ > */ > > #include "config.h" >-#include "FontPlatformData.h" >+#include "FontPlatformDataHarfBuzz.h" > > #include "NotImplemented.h" > #include "PlatformString.h" >-#include "PlatformSupport.h" >- > #include "SkAdvancedTypefaceMetrics.h" > #include "SkFontHost.h" > #include "SkPaint.h" > #include "SkTypeface.h" > >-#include <wtf/text/StringImpl.h> >- > #if USE(HARFBUZZ_NG) > #include "HarfBuzzNGFace.h" > #else > #include "HarfBuzzSkia.h" > #endif > >+#include <public/linux/WebFontInfo.h> >+#include <public/linux/WebFontRenderStyle.h> >+#include <public/linux/WebSandboxSupport.h> >+#include <public/Platform.h> >+#include <wtf/text/StringImpl.h> >+ > namespace WebCore { > > static SkPaint::Hinting skiaHinting = SkPaint::kNormal_Hinting; >@@ -248,7 +250,7 @@ bool FontPlatformData::operator==(const > else > typefacesEqual = SkTypeface::Equal(m_typeface, a.m_typeface); > >- return typefacesEqual >+ return typefacesEqual > && m_textSize == a.m_textSize > && m_fakeBold == a.m_fakeBold > && m_fakeItalic == a.m_fakeItalic >@@ -296,9 +298,27 @@ HarfbuzzFace* FontPlatformData::harfbuzz > } > #endif > >+void FontPlatformData::getRenderStyleForStrike(const char* font, int sizeAndStyle, FontRenderStyle* result) >+{ >+ WebKit::WebFontRenderStyle style; >+ >+#if OS(ANDROID) >+ style.setDefaults(); >+#else >+ if (!font || !*font) >+ style.setDefaults(); // It's probably a webfont. Take the system defaults. >+ else if (WebKit::Platform::current()->sandboxSupport()) >+ WebKit::Platform::current()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style); >+ else >+ WebKit::WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style); >+#endif >+ >+ style.toFontRenderStyle(result); >+} >+ > void FontPlatformData::querySystemForRenderStyle() > { >- PlatformSupport::getRenderStyleForStrike(m_family.data(), (((int)m_textSize) << 2) | (m_typeface->style() & 3), &m_style); >+ getRenderStyleForStrike(m_family.data(), (((int)m_textSize) << 2) | (m_typeface->style() & 3), &m_style); > > // Fix FontRenderStyle::NoPreference to actual styles. > if (m_style.useAntiAlias == FontRenderStyle::NoPreference) >Index: Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h >=================================================================== >--- Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h (revision 127024) >+++ Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h (working copy) >@@ -1,10 +1,10 @@ > /* > * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. >- * >+ * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions are > * met: >- * >+ * > * * Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * * Redistributions in binary form must reproduce the above >@@ -14,7 +14,7 @@ > * * Neither the name of Google Inc. nor the names of its > * contributors may be used to endorse or promote products derived from > * this software without specific prior written permission. >- * >+ * > * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >@@ -126,6 +126,7 @@ public: > static void setSubpixelPositioning(bool); > > private: >+ void getRenderStyleForStrike(const char*, int, FontRenderStyle*); > void querySystemForRenderStyle(); > > // FIXME: Could SkAutoUnref be used here? >Index: Source/WebKit/chromium/ChangeLog >=================================================================== >--- Source/WebKit/chromium/ChangeLog (revision 127026) >+++ Source/WebKit/chromium/ChangeLog (working copy) >@@ -1,3 +1,17 @@ >+2012-08-29 Mark Pilgrim <pilgrim@chromium.org> >+ >+ [Chromium] Remove getRenderStyleForStrike from PlatformSupport >+ https://bugs.webkit.org/show_bug.cgi?id=95363 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Part of a refactoring series. See tracking bug 82948. >+ >+ * public/linux/WebFontInfo.h: >+ * public/linux/WebFontRenderStyle.h: >+ * src/PlatformSupport.cpp: >+ (WebCore): >+ > 2012-08-29 W. James MacLean <wjmaclean@chromium.org> > > [chromium] Link highlight should clear on page navigation. >Index: Source/WebKit/chromium/public/linux/WebFontInfo.h >=================================================================== >--- Source/WebKit/chromium/public/linux/WebFontInfo.h (revision 127024) >+++ Source/WebKit/chromium/public/linux/WebFontInfo.h (working copy) >@@ -28,51 +28,4 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef WebFontInfo_h >-#define WebFontInfo_h >- >-#include "../linux/WebFontRenderStyle.h" >-#include "../platform/WebCString.h" >-#include "../platform/linux/WebFontFamily.h" >- >-#include <string.h> >-#include <unistd.h> >- >-namespace WebKit { >- >-class WebFontInfo { >-public: >- // Set a global preference describing whether renderStyleForStrike() should >- // enable subpixel positioning or not. FontConfig doesn't currently provide >- // a parameter for controlling this. >- WEBKIT_EXPORT static void setSubpixelPositioning(bool); >- >- // Return a font family which provides glyphs for the Unicode code points >- // specified by |utf16| >- // characters: a native-endian UTF16 string >- // numCharacters: the number of 16-bit words in |utf16| >- // preferredLocale: preferred locale identifier for the |characters| >- // (e.g. "en", "ja", "zh-CN") >- // >- // Returns: the font family or an empty string if the request could not be >- // satisfied. >- // Returns: the font family instance. The instance has an empty font name if the request could not be satisfied. >- WEBKIT_EXPORT static void familyForChars(const WebUChar* characters, size_t numCharacters, const char* preferredLocale, WebFontFamily*); >- >- // Fill out the given WebFontRenderStyle with the user's preferences for >- // rendering the given font at the given size (in pixels). >- // family: i.e. "Times New Roman" >- // sizeAndStyle: >- // 3322222222221111111111 >- // 10987654321098765432109876543210 >- // +--------------------------------+ >- // |..............Size............IB| >- // +--------------------------------+ >- // I: italic flag >- // B: bold flag >- WEBKIT_EXPORT static void renderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle* result); >-}; >- >-} // namespace WebKit >- >-#endif >+#include "../../../../Platform/chromium/public/linux/WebFontInfo.h" >Index: Source/WebKit/chromium/public/linux/WebFontRenderStyle.h >=================================================================== >--- Source/WebKit/chromium/public/linux/WebFontRenderStyle.h (revision 127024) >+++ Source/WebKit/chromium/public/linux/WebFontRenderStyle.h (working copy) >@@ -28,36 +28,4 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef WebFontRenderStyle_h >-#define WebFontRenderStyle_h >- >-#include "../platform/WebCommon.h" >- >-namespace WebCore { struct FontRenderStyle; } >- >-namespace WebKit { >- >-struct WEBKIT_EXPORT WebFontRenderStyle { >- // Each of the use* members below can take one of three values: >- // 0: off >- // 1: on >- // 2: no preference expressed >- char useBitmaps; // use embedded bitmap strike if possible >- char useAutoHint; // use 'auto' hinting (FreeType specific) >- char useHinting; // hint glyphs to the pixel grid >- char hintStyle; // level of hinting, 0..3 >- char useAntiAlias; // antialias glyph shapes >- char useSubpixelRendering; // use subpixel rendering (partially-filled pixels) >- char useSubpixelPositioning; // use subpixel positioning (fractional X positions for glyphs) >- >-#if WEBKIT_IMPLEMENTATION >- // Translates the members of this struct to a FontRenderStyle >- void toFontRenderStyle(WebCore::FontRenderStyle*); >-#endif >- >- void setDefaults(); >-}; >- >-} // namespace WebKit >- >-#endif // WebFontRenderStyle_h >+#include "../../../../Platform/chromium/public/linux/WebFontRenderStyle.h" >Index: Source/WebKit/chromium/src/PlatformSupport.cpp >=================================================================== >--- Source/WebKit/chromium/src/PlatformSupport.cpp (revision 127024) >+++ Source/WebKit/chromium/src/PlatformSupport.cpp (working copy) >@@ -255,23 +255,6 @@ void PlatformSupport::getFontFamilyForCh > #endif > } > >-void PlatformSupport::getRenderStyleForStrike(const char* font, int sizeAndStyle, FontRenderStyle* result) >-{ >- WebFontRenderStyle style; >- >-#if OS(ANDROID) >- style.setDefaults(); >-#else >- if (!font || !*font) >- style.setDefaults(); // It's probably a webfont. Take the system defaults. >- else if (WebKit::Platform::current()->sandboxSupport()) >- WebKit::Platform::current()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style); >- else >- WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style); >-#endif >- >- style.toFontRenderStyle(result); >-} > #endif > > // Indexed Database -----------------------------------------------------------
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 95363
:
161278
|
161301