Title: [120511] trunk
Revision
120511
Author
[email protected]
Date
2012-06-15 17:24:09 -0700 (Fri, 15 Jun 2012)

Log Message

[Chromium] Move chromium/public/linuxish/WebFontRendering.h out of linuxish directory
https://bugs.webkit.org/show_bug.cgi?id=89228

Source/WebCore:

Reverse the dependency originally from WebKit::WebFontRendering to WebCore::FontPlatformDataHarfBuzz
so that WebKit::WebFontRendering can be platform-independent.

Reviewed by Tony Chang.

Refactory only. No new tests.

* platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp:
(WebCore::FontPlatformData::setupPaint):
* platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h:
(FontPlatformData):

Source/WebKit/chromium:

Reverse dependency originally from WebCore::FontPlatformDataHarfBuzz to WebKit::WebFontRendering
so that WebKit::WebFontRendering can be platform-independent.

This also avoids the ambiguous name 'linuxish'.

Reviewed by Tony Chang.

* WebKit.gyp:
* public/WebFontRendering.h: Copied from Source/WebKit/chromium/public/linuxish/WebFontRendering.h. Added getters under WEBKIT_IMPLEMENTATION.
(WebFontRendering):
* public/linux/WebFontRendering.h:
* public/linuxish: Removed.
* public/linuxish/WebFontRendering.h: Removed.
* src/WebFontRendering.cpp: Copied from Source/WebKit/chromium/src/linuxish/WebFontRendering.cpp. Changed setters to be independent of platform-dependent implementation and added getters.
(WebKit):
(WebKit::WebFontRendering::setHinting):
(WebKit::WebFontRendering::hinting):
(WebKit::WebFontRendering::setAutoHint):
(WebKit::WebFontRendering::autoHint):
(WebKit::WebFontRendering::setUseBitmaps):
(WebKit::WebFontRendering::useBitmaps):
(WebKit::WebFontRendering::setAntiAlias):
(WebKit::WebFontRendering::antiAlias):
(WebKit::WebFontRendering::setSubpixelRendering):
(WebKit::WebFontRendering::subpixelRendering):
(WebKit::WebFontRendering::setSubpixelPositioning):
(WebKit::WebFontRendering::subpixelPositioning):
* src/linuxish: Removed.
* src/linuxish/WebFontRendering.cpp: Removed.

Tools:

Reviewed by Tony Chang.

* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::reset):
(LayoutTestController::setTextSubpixelPositioning):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (120510 => 120511)


--- trunk/Source/WebCore/ChangeLog	2012-06-15 23:35:34 UTC (rev 120510)
+++ trunk/Source/WebCore/ChangeLog	2012-06-16 00:24:09 UTC (rev 120511)
@@ -1,3 +1,20 @@
+2012-06-15  Xianzhu Wang  <[email protected]>
+
+        [Chromium] Move chromium/public/linuxish/WebFontRendering.h out of linuxish directory
+        https://bugs.webkit.org/show_bug.cgi?id=89228
+
+        Reverse the dependency originally from WebKit::WebFontRendering to WebCore::FontPlatformDataHarfBuzz
+        so that WebKit::WebFontRendering can be platform-independent.
+
+        Reviewed by Tony Chang.
+
+        Refactory only. No new tests.
+
+        * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp:
+        (WebCore::FontPlatformData::setupPaint):
+        * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h:
+        (FontPlatformData):
+
 2012-06-15  Adrienne Walker  <[email protected]>
 
         [chromium] Fix composited scrollbars with transparent thumbs

Modified: trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp (120510 => 120511)


--- trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp	2012-06-15 23:35:34 UTC (rev 120510)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp	2012-06-16 00:24:09 UTC (rev 120511)
@@ -40,47 +40,13 @@
 #include "SkPaint.h"
 #include "SkTypeface.h"
 
-#include <wtf/text/StringImpl.h> 
+#include <public/WebFontRendering.h>
+#include <wtf/text/StringImpl.h>
 
+using WebKit::WebFontRendering;
+
 namespace WebCore {
 
-static SkPaint::Hinting skiaHinting = SkPaint::kNormal_Hinting;
-static bool useSkiaAutoHint = true;
-static bool useSkiaBitmaps = true;
-static bool useSkiaAntiAlias = true;
-static bool useSkiaSubpixelRendering = false;
-static bool useSkiaSubpixelPositioning = false;
-
-void FontPlatformData::setHinting(SkPaint::Hinting hinting)
-{
-    skiaHinting = hinting;
-}
-
-void FontPlatformData::setAutoHint(bool useAutoHint)
-{
-    useSkiaAutoHint = useAutoHint;
-}
-
-void FontPlatformData::setUseBitmaps(bool useBitmaps)
-{
-    useSkiaBitmaps = useBitmaps;
-}
-
-void FontPlatformData::setAntiAlias(bool useAntiAlias)
-{
-    useSkiaAntiAlias = useAntiAlias;
-}
-
-void FontPlatformData::setSubpixelRendering(bool useSubpixelRendering)
-{
-    useSkiaSubpixelRendering = useSubpixelRendering;
-}
-
-void FontPlatformData::setSubpixelPositioning(bool useSubpixelPositioning)
-{
-    useSkiaSubpixelPositioning = useSubpixelPositioning;
-}
-
 FontPlatformData::FontPlatformData(const FontPlatformData& src)
     : m_typeface(src.m_typeface)
     , m_family(src.m_family)
@@ -177,10 +143,10 @@
 {
     const float ts = m_textSize >= 0 ? m_textSize : 12;
 
-    paint->setAntiAlias(m_style.useAntiAlias == FontRenderStyle::NoPreference ? useSkiaAntiAlias : m_style.useAntiAlias);
+    paint->setAntiAlias(m_style.useAntiAlias == FontRenderStyle::NoPreference ? WebFontRendering::antiAlias() : m_style.useAntiAlias);
     switch (m_style.useHinting) {
     case FontRenderStyle::NoPreference:
-        paint->setHinting(skiaHinting);
+        paint->setHinting(WebFontRendering::hinting());
         break;
     case 0:
         paint->setHinting(SkPaint::kNo_Hinting);
@@ -190,16 +156,16 @@
         break;
     }
 
-    paint->setEmbeddedBitmapText(m_style.useBitmaps == FontRenderStyle::NoPreference ? useSkiaBitmaps : m_style.useBitmaps);
+    paint->setEmbeddedBitmapText(m_style.useBitmaps == FontRenderStyle::NoPreference ? WebFontRendering::useBitmaps() : m_style.useBitmaps);
     paint->setTextSize(SkFloatToScalar(ts));
     paint->setTypeface(m_typeface);
     paint->setFakeBoldText(m_fakeBold);
     paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0);
-    paint->setAutohinted(m_style.useAutoHint == FontRenderStyle::NoPreference ? useSkiaAutoHint : m_style.useAutoHint);
-    paint->setSubpixelText(m_style.useSubpixelPositioning == FontRenderStyle::NoPreference ? useSkiaSubpixelPositioning : m_style.useSubpixelPositioning);
+    paint->setAutohinted(m_style.useAutoHint == FontRenderStyle::NoPreference ? WebFontRendering::autoHint() : m_style.useAutoHint);
+    paint->setSubpixelText(m_style.useSubpixelPositioning == FontRenderStyle::NoPreference ? WebFontRendering::subpixelPositioning() : m_style.useSubpixelPositioning);
 
-    if (m_style.useAntiAlias == 1 || (m_style.useAntiAlias == FontRenderStyle::NoPreference && useSkiaAntiAlias))
-        paint->setLCDRenderText(m_style.useSubpixelRendering == FontRenderStyle::NoPreference ? useSkiaSubpixelRendering : m_style.useSubpixelRendering);
+    if (m_style.useAntiAlias == 1 || (m_style.useAntiAlias == FontRenderStyle::NoPreference && WebFontRendering::antiAlias()))
+        paint->setLCDRenderText(m_style.useSubpixelRendering == FontRenderStyle::NoPreference ? WebFontRendering::subpixelRendering() : m_style.useSubpixelRendering);
 }
 
 SkFontID FontPlatformData::uniqueID() const

Modified: trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h (120510 => 120511)


--- trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h	2012-06-15 23:35:34 UTC (rev 120510)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h	2012-06-16 00:24:09 UTC (rev 120511)
@@ -130,16 +130,6 @@
 
     HarfbuzzFace* harfbuzzFace() const;
 
-    // -------------------------------------------------------------------------
-    // Global font preferences...
-
-    static void setHinting(SkPaint::Hinting);
-    static void setAutoHint(bool);
-    static void setUseBitmaps(bool);
-    static void setAntiAlias(bool);
-    static void setSubpixelRendering(bool);
-    static void setSubpixelPositioning(bool);
-
 private:
     void querySystemForRenderStyle();
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (120510 => 120511)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-06-15 23:35:34 UTC (rev 120510)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-06-16 00:24:09 UTC (rev 120511)
@@ -1,3 +1,38 @@
+2012-06-15  Xianzhu Wang  <[email protected]>
+
+        [Chromium] Move chromium/public/linuxish/WebFontRendering.h out of linuxish directory
+        https://bugs.webkit.org/show_bug.cgi?id=89228
+
+        Reverse dependency originally from WebCore::FontPlatformDataHarfBuzz to WebKit::WebFontRendering
+        so that WebKit::WebFontRendering can be platform-independent.
+
+        This also avoids the ambiguous name 'linuxish'.
+
+        Reviewed by Tony Chang.
+
+        * WebKit.gyp:
+        * public/WebFontRendering.h: Copied from Source/WebKit/chromium/public/linuxish/WebFontRendering.h. Added getters under WEBKIT_IMPLEMENTATION.
+        (WebFontRendering):
+        * public/linux/WebFontRendering.h:
+        * public/linuxish: Removed.
+        * public/linuxish/WebFontRendering.h: Removed.
+        * src/WebFontRendering.cpp: Copied from Source/WebKit/chromium/src/linuxish/WebFontRendering.cpp. Changed setters to be independent of platform-dependent implementation and added getters.
+        (WebKit):
+        (WebKit::WebFontRendering::setHinting):
+        (WebKit::WebFontRendering::hinting):
+        (WebKit::WebFontRendering::setAutoHint):
+        (WebKit::WebFontRendering::autoHint):
+        (WebKit::WebFontRendering::setUseBitmaps):
+        (WebKit::WebFontRendering::useBitmaps):
+        (WebKit::WebFontRendering::setAntiAlias):
+        (WebKit::WebFontRendering::antiAlias):
+        (WebKit::WebFontRendering::setSubpixelRendering):
+        (WebKit::WebFontRendering::subpixelRendering):
+        (WebKit::WebFontRendering::setSubpixelPositioning):
+        (WebKit::WebFontRendering::subpixelPositioning):
+        * src/linuxish: Removed.
+        * src/linuxish/WebFontRendering.cpp: Removed.
+
 2012-06-15  Tony Chang  <[email protected]>
 
         [chromium] Remove WebKit/chromium/public/gtk/WebFontInfo.h since it's no longer referenced.

Modified: trunk/Source/WebKit/chromium/WebKit.gyp (120510 => 120511)


--- trunk/Source/WebKit/chromium/WebKit.gyp	2012-06-15 23:35:34 UTC (rev 120510)
+++ trunk/Source/WebKit/chromium/WebKit.gyp	2012-06-16 00:24:09 UTC (rev 120511)
@@ -155,6 +155,7 @@
                 'public/WebFont.h',
                 'public/WebFontCache.h',
                 'public/WebFontDescription.h',
+                'public/WebFontRendering.h',
                 'public/WebFormControlElement.h',
                 'public/WebFormElement.h',
                 'public/WebFrame.h',
@@ -285,7 +286,6 @@
                 'public/gtk/WebInputEventFactory.h',
                 'public/linux/WebFontRenderStyle.h',
                 'public/linux/WebRenderTheme.h',
-                'public/linuxish/WebFontRendering.h',
                 'public/mac/WebInputEventFactory.h',
                 'public/mac/WebSandboxSupport.h',
                 'public/mac/WebScreenInfoFactory.h',
@@ -430,7 +430,6 @@
                 'src/linux/WebFontInfo.cpp',
                 'src/linux/WebFontRenderStyle.cpp',
                 'src/linux/WebRenderTheme.cpp',
-                'src/linuxish/WebFontRendering.cpp',
                 'src/x11/WebScreenInfoFactory.cpp',
                 'src/mac/WebInputEventFactory.mm',
                 'src/mac/WebScreenInfoFactory.mm',
@@ -528,6 +527,7 @@
                 'src/WebFontDescription.cpp',
                 'src/WebFontImpl.cpp',
                 'src/WebFontImpl.h',
+                'src/WebFontRendering.cpp',
                 'src/WebFormControlElement.cpp',
                 'src/WebFormElement.cpp',
                 'src/WebFrameImpl.cpp',

Copied: trunk/Source/WebKit/chromium/public/WebFontRendering.h (from rev 120510, trunk/Source/WebKit/chromium/public/linuxish/WebFontRendering.h) (0 => 120511)


--- trunk/Source/WebKit/chromium/public/WebFontRendering.h	                        (rev 0)
+++ trunk/Source/WebKit/chromium/public/WebFontRendering.h	2012-06-16 00:24:09 UTC (rev 120511)
@@ -0,0 +1,67 @@
+/*
+ * 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 WebFontRendering_h
+#define WebFontRendering_h
+
+#include "platform/WebCommon.h"
+#include <SkFontHost.h>
+#include <SkPaint.h>
+
+namespace WebKit {
+
+class WebFontRendering {
+public:
+    // Set global font renderering preferences.
+    // Whether they work on particular platform depends on the implementation of
+    // Skia on the platform.
+
+    WEBKIT_EXPORT static void setHinting(SkPaint::Hinting);
+    WEBKIT_EXPORT static void setAutoHint(bool);
+    WEBKIT_EXPORT static void setUseBitmaps(bool);
+    WEBKIT_EXPORT static void setAntiAlias(bool);
+    WEBKIT_EXPORT static void setSubpixelRendering(bool);
+    WEBKIT_EXPORT static void setSubpixelPositioning(bool);
+    WEBKIT_EXPORT static void setLCDOrder(SkFontHost::LCDOrder);
+    WEBKIT_EXPORT static void setLCDOrientation(SkFontHost::LCDOrientation);
+
+#if WEBKIT_IMPLEMENTATION
+    static SkPaint::Hinting hinting();
+    static bool autoHint();
+    static bool useBitmaps();
+    static bool antiAlias();
+    static bool subpixelRendering();
+    static bool subpixelPositioning();
+#endif
+};
+
+} // namespace WebKit
+
+#endif

Modified: trunk/Source/WebKit/chromium/public/linux/WebFontRendering.h (120510 => 120511)


--- trunk/Source/WebKit/chromium/public/linux/WebFontRendering.h	2012-06-15 23:35:34 UTC (rev 120510)
+++ trunk/Source/WebKit/chromium/public/linux/WebFontRendering.h	2012-06-16 00:24:09 UTC (rev 120511)
@@ -28,4 +28,4 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 // FIXME: Remove once http://codereview.chromium.org/10544103/ is landed.
-#include "../linuxish/WebFontRendering.h"
+#include "../WebFontRendering.h"

Deleted: trunk/Source/WebKit/chromium/public/linuxish/WebFontRendering.h (120510 => 120511)


--- trunk/Source/WebKit/chromium/public/linuxish/WebFontRendering.h	2012-06-15 23:35:34 UTC (rev 120510)
+++ trunk/Source/WebKit/chromium/public/linuxish/WebFontRendering.h	2012-06-16 00:24:09 UTC (rev 120511)
@@ -1,56 +0,0 @@
-/*
- * 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 WebFontRendering_h
-#define WebFontRendering_h
-
-#include "../platform/WebCommon.h"
-#include <SkFontHost.h>
-#include <SkPaint.h>
-
-namespace WebKit {
-
-class WebFontRendering {
-public:
-    // Set global font renderering preferences.
-
-    WEBKIT_EXPORT static void setHinting(SkPaint::Hinting);
-    WEBKIT_EXPORT static void setAutoHint(bool);
-    WEBKIT_EXPORT static void setUseBitmaps(bool);
-    WEBKIT_EXPORT static void setAntiAlias(bool);
-    WEBKIT_EXPORT static void setSubpixelRendering(bool);
-    WEBKIT_EXPORT static void setSubpixelPositioning(bool);
-    WEBKIT_EXPORT static void setLCDOrder(SkFontHost::LCDOrder);
-    WEBKIT_EXPORT static void setLCDOrientation(SkFontHost::LCDOrientation);
-};
-
-} // namespace WebKit
-
-#endif

Copied: trunk/Source/WebKit/chromium/src/WebFontRendering.cpp (from rev 120510, trunk/Source/WebKit/chromium/src/linuxish/WebFontRendering.cpp) (0 => 120511)


--- trunk/Source/WebKit/chromium/src/WebFontRendering.cpp	                        (rev 0)
+++ trunk/Source/WebKit/chromium/src/WebFontRendering.cpp	2012-06-16 00:24:09 UTC (rev 120511)
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include "WebFontRendering.h"
+
+#if OS(LINUX)
+#include "WebFontInfo.h"
+#endif
+
+namespace {
+
+SkPaint::Hinting skiaHinting = SkPaint::kNormal_Hinting;
+bool useSkiaAutoHint = true;
+bool useSkiaBitmaps = true;
+bool useSkiaAntiAlias = true;
+bool useSkiaSubpixelRendering = false;
+bool useSkiaSubpixelPositioning = false;
+
+}
+
+namespace WebKit {
+
+// static
+void WebFontRendering::setHinting(SkPaint::Hinting hinting)
+{
+    skiaHinting = hinting;
+}
+
+// static
+SkPaint::Hinting WebFontRendering::hinting()
+{
+    return skiaHinting;
+}
+
+// static
+void WebFontRendering::setAutoHint(bool useAutoHint)
+{
+    useSkiaAutoHint = useAutoHint;
+}
+
+// static
+bool WebFontRendering::autoHint()
+{
+    return useSkiaAutoHint;
+}
+
+// static
+void WebFontRendering::setUseBitmaps(bool useBitmaps)
+{
+    useSkiaBitmaps = useBitmaps;
+}
+
+// static
+bool WebFontRendering::useBitmaps()
+{
+    return useSkiaBitmaps;
+}
+
+// static
+void WebFontRendering::setAntiAlias(bool useAntiAlias)
+{
+    useSkiaAntiAlias = useAntiAlias;
+}
+
+// static
+bool WebFontRendering::antiAlias()
+{
+    return useSkiaAntiAlias;
+}
+
+// static
+void WebFontRendering::setSubpixelRendering(bool useSubpixelRendering)
+{
+    useSkiaSubpixelRendering = useSubpixelRendering;
+}
+
+// static
+bool WebFontRendering::subpixelRendering()
+{
+    return useSkiaSubpixelRendering;
+}
+
+// static
+void WebFontRendering::setSubpixelPositioning(bool useSubpixelPositioning)
+{
+    useSkiaSubpixelPositioning = useSubpixelPositioning;
+#if OS(LINUX)
+    WebFontInfo::setSubpixelPositioning(useSubpixelPositioning);
+#endif
+}
+
+// static
+bool WebFontRendering::subpixelPositioning()
+{
+    return useSkiaSubpixelPositioning;
+}
+
+// static
+void WebFontRendering::setLCDOrder(SkFontHost::LCDOrder order)
+{
+    SkFontHost::SetSubpixelOrder(order);
+}
+
+// static
+void WebFontRendering::setLCDOrientation(SkFontHost::LCDOrientation orientation)
+{
+    SkFontHost::SetSubpixelOrientation(orientation);
+}
+
+} // namespace WebKit

Deleted: trunk/Source/WebKit/chromium/src/linuxish/WebFontRendering.cpp (120510 => 120511)


--- trunk/Source/WebKit/chromium/src/linuxish/WebFontRendering.cpp	2012-06-15 23:35:34 UTC (rev 120510)
+++ trunk/Source/WebKit/chromium/src/linuxish/WebFontRendering.cpp	2012-06-16 00:24:09 UTC (rev 120511)
@@ -1,95 +0,0 @@
-/*
- * 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.
- */
-
-#include "config.h"
-#include "WebFontRendering.h"
-
-#include "FontPlatformData.h"
-
-#if OS(LINUX)
-#include "WebFontInfo.h"
-#endif
-
-using WebCore::FontPlatformData;
-
-namespace WebKit {
-
-// static
-void WebFontRendering::setHinting(SkPaint::Hinting hinting)
-{
-    FontPlatformData::setHinting(hinting);
-}
-
-// static
-void WebFontRendering::setAutoHint(bool useAutoHint)
-{
-    FontPlatformData::setAutoHint(useAutoHint);
-}
-
-// static
-void WebFontRendering::setUseBitmaps(bool useBitmaps)
-{
-    FontPlatformData::setUseBitmaps(useBitmaps);
-}
-
-// static
-void WebFontRendering::setAntiAlias(bool useAntiAlias)
-{
-    FontPlatformData::setAntiAlias(useAntiAlias);
-}
-
-// static
-void WebFontRendering::setSubpixelRendering(bool useSubpixelRendering)
-{
-    FontPlatformData::setSubpixelRendering(useSubpixelRendering);
-}
-
-// static
-void WebFontRendering::setSubpixelPositioning(bool useSubpixelPositioning)
-{
-    FontPlatformData::setSubpixelPositioning(useSubpixelPositioning);
-#if OS(LINUX)
-    WebFontInfo::setSubpixelPositioning(useSubpixelPositioning);
-#endif
-}
-
-// static
-void WebFontRendering::setLCDOrder(SkFontHost::LCDOrder order)
-{
-    SkFontHost::SetSubpixelOrder(order);
-}
-
-// static
-void WebFontRendering::setLCDOrientation(SkFontHost::LCDOrientation orientation)
-{
-    SkFontHost::SetSubpixelOrientation(orientation);
-}
-
-} // namespace WebKit

Modified: trunk/Tools/ChangeLog (120510 => 120511)


--- trunk/Tools/ChangeLog	2012-06-15 23:35:34 UTC (rev 120510)
+++ trunk/Tools/ChangeLog	2012-06-16 00:24:09 UTC (rev 120511)
@@ -1,3 +1,14 @@
+2012-06-15  Xianzhu Wang  <[email protected]>
+
+        [Chromium] Move chromium/public/linuxish/WebFontRendering.h out of linuxish directory
+        https://bugs.webkit.org/show_bug.cgi?id=89228
+
+        Reviewed by Tony Chang.
+
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::reset):
+        (LayoutTestController::setTextSubpixelPositioning):
+
 2012-06-15  Dirk Pranke  <[email protected]>
 
         webkitpy: remove DummyOptions and clean up the code in Port.get_option() and Port.set_option_default()

Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp (120510 => 120511)


--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp	2012-06-15 23:35:34 UTC (rev 120510)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp	2012-06-16 00:24:09 UTC (rev 120511)
@@ -46,6 +46,7 @@
 #include "WebDocument.h"
 #include "WebElement.h"
 #include "WebFindOptions.h"
+#include "WebFontRendering.h"
 #include "WebFrame.h"
 #include "WebGeolocationClientMock.h"
 #include "WebIDBFactory.h"
@@ -78,10 +79,6 @@
 #include <wtf/OwnArrayPtr.h>
 #endif
 
-#if OS(LINUX) || OS(ANDROID)
-#include "linuxish/WebFontRendering.h"
-#endif
-
 using namespace WebCore;
 using namespace WebKit;
 using namespace std;
@@ -701,9 +698,7 @@
     m_taskList.revokeAll();
     m_shouldStayOnPageAfterHandlingBeforeUnload = false;
     m_hasCustomFullScreenBehavior = false;
-#if OS(LINUX) || OS(ANDROID)
     WebFontRendering::setSubpixelPositioning(false);
-#endif
 }
 
 void LayoutTestController::locationChangeDone()
@@ -2194,12 +2189,10 @@
 
 void LayoutTestController::setTextSubpixelPositioning(const CppArgumentList& arguments, CppVariant* result)
 {
-#if OS(LINUX) || OS(ANDROID)
     // Since FontConfig doesn't provide a variable to control subpixel positioning, we'll fall back
     // to setting it globally for all fonts.
     if (arguments.size() > 0 && arguments[0].isBool())
         WebFontRendering::setSubpixelPositioning(arguments[0].value.boolValue);
-#endif
     result->setNull();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to