Diff
Modified: trunk/Source/WebCore/ChangeLog (123585 => 123586)
--- trunk/Source/WebCore/ChangeLog 2012-07-25 08:00:53 UTC (rev 123585)
+++ trunk/Source/WebCore/ChangeLog 2012-07-25 08:18:59 UTC (rev 123586)
@@ -1,3 +1,31 @@
+2012-07-25 Kenichi Ishibashi <ba...@chromium.org>
+
+ [Chromium] Fix up includes in HarfBuzzNGFace.h
+ https://bugs.webkit.org/show_bug.cgi?id=92127
+
+ Reviewed by Hajime Morita.
+
+ Move constructors of FontPlatformData from headers to corresponding cpp files
+ so that we can use forward declaration for HarfBuzzNGFace instead of including HarfBuzzNGFace.h.
+ This way we can include hb.h in HarfBuzzNGFace.h.
+
+ No new tests. No changes in behavior.
+
+ * platform/graphics/FontPlatformData.cpp:
+ (WebCore::FontPlatformData::FontPlatformData): Moved from header file.
+ (WebCore):
+ * platform/graphics/FontPlatformData.h:
+ (WebCore):
+ (FontPlatformData): Moved to cpp file.
+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Include HarfBuzzNGFace.h
+ * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp:
+ (WebCore::FontPlatformData::FontPlatformData): Moved from header file.
+ (WebCore):
+ * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h:
+ (WebCore):
+ (FontPlatformData): Moved to cpp file.
+ * platform/graphics/harfbuzz/ng/HarfBuzzNGFace.h: Include hb.h.
+
2012-07-24 Benjamin Poulain <bpoul...@apple.com> && Joseph Pecoraro <pecor...@apple.com>
QualifiedName's HashSet should be big enough to hold at least all the static names
Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp (123585 => 123586)
--- trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp 2012-07-25 08:00:53 UTC (rev 123585)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp 2012-07-25 08:18:59 UTC (rev 123586)
@@ -27,10 +27,112 @@
#include <wtf/Vector.h>
#include <wtf/text/StringHash.h>
+#if PLATFORM(CHROMIUM) && OS(DARWIN)
+#include "HarfBuzzNGFace.h"
+#endif
+
using namespace std;
namespace WebCore {
+FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType)
+ : m_syntheticBold(false)
+ , m_syntheticOblique(false)
+ , m_orientation(Horizontal)
+ , m_textOrientation(TextOrientationVerticalRight)
+ , m_size(0)
+ , m_widthVariant(RegularWidth)
+#if PLATFORM(WIN)
+ , m_font(WTF::HashTableDeletedValue)
+#elif OS(DARWIN)
+ , m_font(hashTableDeletedFontValue())
+#endif
+#if USE(CG) && PLATFORM(WIN)
+ , m_cgFont(0)
+#elif USE(CAIRO)
+ , m_scaledFont(hashTableDeletedFontValue())
+#endif
+ , m_isColorBitmapFont(false)
+ , m_isCompositeFontReference(false)
+#if OS(DARWIN)
+ , m_isPrinterFont(false)
+#endif
+#if PLATFORM(WIN)
+ , m_useGDI(false)
+#endif
+{
+}
+
+FontPlatformData::FontPlatformData()
+ : m_syntheticBold(false)
+ , m_syntheticOblique(false)
+ , m_orientation(Horizontal)
+ , m_textOrientation(TextOrientationVerticalRight)
+ , m_size(0)
+ , m_widthVariant(RegularWidth)
+#if OS(DARWIN)
+ , m_font(0)
+#endif
+#if USE(CG) && PLATFORM(WIN)
+ , m_cgFont(0)
+#elif USE(CAIRO)
+ , m_scaledFont(0)
+#endif
+ , m_isColorBitmapFont(false)
+ , m_isCompositeFontReference(false)
+#if OS(DARWIN)
+ , m_isPrinterFont(false)
+#endif
+#if PLATFORM(WIN)
+ , m_useGDI(false)
+#endif
+{
+}
+
+FontPlatformData::FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, TextOrientation textOrientation, FontWidthVariant widthVariant)
+ : m_syntheticBold(syntheticBold)
+ , m_syntheticOblique(syntheticOblique)
+ , m_orientation(orientation)
+ , m_textOrientation(textOrientation)
+ , m_size(size)
+ , m_widthVariant(widthVariant)
+#if OS(DARWIN)
+ , m_font(0)
+#endif
+#if USE(CG) && PLATFORM(WIN)
+ , m_cgFont(0)
+#elif USE(CAIRO)
+ , m_scaledFont(0)
+#endif
+ , m_isColorBitmapFont(false)
+ , m_isCompositeFontReference(false)
+#if OS(DARWIN)
+ , m_isPrinterFont(false)
+#endif
+#if PLATFORM(WIN)
+ , m_useGDI(false)
+#endif
+{
+}
+
+#if OS(DARWIN) && (USE(CG) || USE(SKIA_ON_MAC_CHROMIUM))
+FontPlatformData::FontPlatformData(CGFontRef cgFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation,
+ TextOrientation textOrientation, FontWidthVariant widthVariant)
+ : m_syntheticBold(syntheticBold)
+ , m_syntheticOblique(syntheticOblique)
+ , m_orientation(orientation)
+ , m_textOrientation(textOrientation)
+ , m_size(size)
+ , m_widthVariant(widthVariant)
+ , m_font(0)
+ , m_cgFont(cgFont)
+ , m_isColorBitmapFont(false)
+ , m_isCompositeFontReference(false)
+ , m_isPrinterFont(false)
+{
+}
+#endif
+
FontPlatformData::FontPlatformData(const FontPlatformData& source)
: m_syntheticBold(source.m_syntheticBold)
, m_syntheticOblique(source.m_syntheticOblique)
Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.h (123585 => 123586)
--- trunk/Source/WebCore/platform/graphics/FontPlatformData.h 2012-07-25 08:00:53 UTC (rev 123585)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.h 2012-07-25 08:18:59 UTC (rev 123586)
@@ -72,7 +72,6 @@
#if PLATFORM(CHROMIUM) && OS(DARWIN)
#include "CrossProcessFontLoading.h"
-#include "HarfBuzzNGFace.h"
#endif
#if PLATFORM(WIN)
@@ -94,114 +93,29 @@
class FontDescription;
class SharedBuffer;
+#if PLATFORM(CHROMIUM) && OS(DARWIN)
+class HarfBuzzNGFace;
+#endif
+
#if OS(DARWIN)
inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef>(nsFont); }
#endif
class FontPlatformData {
public:
- FontPlatformData(WTF::HashTableDeletedValueType)
- : m_syntheticBold(false)
- , m_syntheticOblique(false)
- , m_orientation(Horizontal)
- , m_textOrientation(TextOrientationVerticalRight)
- , m_size(0)
- , m_widthVariant(RegularWidth)
-#if PLATFORM(WIN)
- , m_font(WTF::HashTableDeletedValue)
-#elif OS(DARWIN)
- , m_font(hashTableDeletedFontValue())
-#endif
-#if USE(CG) && PLATFORM(WIN)
- , m_cgFont(0)
-#elif USE(CAIRO)
- , m_scaledFont(hashTableDeletedFontValue())
-#endif
- , m_isColorBitmapFont(false)
- , m_isCompositeFontReference(false)
-#if OS(DARWIN)
- , m_isPrinterFont(false)
-#endif
-#if PLATFORM(WIN)
- , m_useGDI(false)
-#endif
- {
- }
-
- FontPlatformData()
- : m_syntheticBold(false)
- , m_syntheticOblique(false)
- , m_orientation(Horizontal)
- , m_textOrientation(TextOrientationVerticalRight)
- , m_size(0)
- , m_widthVariant(RegularWidth)
-#if OS(DARWIN)
- , m_font(0)
-#endif
-#if USE(CG) && PLATFORM(WIN)
- , m_cgFont(0)
-#elif USE(CAIRO)
- , m_scaledFont(0)
-#endif
- , m_isColorBitmapFont(false)
- , m_isCompositeFontReference(false)
-#if OS(DARWIN)
- , m_isPrinterFont(false)
-#endif
-#if PLATFORM(WIN)
- , m_useGDI(false)
-#endif
- {
- }
-
+ FontPlatformData(WTF::HashTableDeletedValueType);
+ FontPlatformData();
FontPlatformData(const FontPlatformData&);
FontPlatformData(const FontDescription&, const AtomicString& family);
- FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation = Horizontal,
- TextOrientation textOrientation = TextOrientationVerticalRight, FontWidthVariant widthVariant = RegularWidth)
- : m_syntheticBold(syntheticBold)
- , m_syntheticOblique(syntheticOblique)
- , m_orientation(orientation)
- , m_textOrientation(textOrientation)
- , m_size(size)
- , m_widthVariant(widthVariant)
-#if OS(DARWIN)
- , m_font(0)
-#endif
-#if USE(CG) && PLATFORM(WIN)
- , m_cgFont(0)
-#elif USE(CAIRO)
- , m_scaledFont(0)
-#endif
- , m_isColorBitmapFont(false)
- , m_isCompositeFontReference(false)
-#if OS(DARWIN)
- , m_isPrinterFont(false)
-#endif
-#if PLATFORM(WIN)
- , m_useGDI(false)
-#endif
- {
- }
+ FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation = Horizontal,
+ TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth);
#if OS(DARWIN)
FontPlatformData(NSFont*, float size, bool isPrinterFont = false, bool syntheticBold = false, bool syntheticOblique = false,
FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth);
#if USE(CG) || USE(SKIA_ON_MAC_CHROMIUM)
- FontPlatformData(CGFontRef cgFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation,
- TextOrientation textOrientation, FontWidthVariant widthVariant)
- : m_syntheticBold(syntheticBold)
- , m_syntheticOblique(syntheticOblique)
- , m_orientation(orientation)
- , m_textOrientation(textOrientation)
- , m_size(size)
- , m_widthVariant(widthVariant)
- , m_font(0)
- , m_cgFont(cgFont)
- , m_isColorBitmapFont(false)
- , m_isCompositeFontReference(false)
- , m_isPrinterFont(false)
- {
- }
+ FontPlatformData(CGFontRef, float size, bool syntheticBold, bool syntheticOblique, FontOrientation,
+ TextOrientation, FontWidthVariant);
#endif
#endif
#if PLATFORM(WIN)
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm (123585 => 123586)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm 2012-07-25 08:00:53 UTC (rev 123585)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm 2012-07-25 08:18:59 UTC (rev 123586)
@@ -28,6 +28,10 @@
#import "WebCoreSystemInterface.h"
#import <AppKit/NSFont.h>
+#if PLATFORM(CHROMIUM) && OS(DARWIN)
+#import "HarfBuzzNGFace.h"
+#endif
+
namespace WebCore {
// These CoreText Text Spacing feature selectors are not defined in CoreText.
Modified: trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp (123585 => 123586)
--- trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp 2012-07-25 08:00:53 UTC (rev 123585)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp 2012-07-25 08:18:59 UTC (rev 123586)
@@ -42,6 +42,12 @@
#include <wtf/text/StringImpl.h>
+#if USE(HARFBUZZ_NG)
+#include "HarfBuzzNGFace.h"
+#else
+#include "HarfBuzzSkia.h"
+#endif
+
namespace WebCore {
static SkPaint::Hinting skiaHinting = SkPaint::kNormal_Hinting;
@@ -81,6 +87,39 @@
useSkiaSubpixelPositioning = useSubpixelPositioning;
}
+FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType)
+ : m_typeface(hashTableDeletedFontValue())
+ , m_textSize(0)
+ , m_emSizeInFontUnits(0)
+ , m_fakeBold(false)
+ , m_fakeItalic(false)
+ , m_orientation(Horizontal)
+ , m_textOrientation(TextOrientationVerticalRight)
+{
+}
+
+FontPlatformData::FontPlatformData()
+ : m_typeface(0)
+ , m_textSize(0)
+ , m_emSizeInFontUnits(0)
+ , m_fakeBold(false)
+ , m_fakeItalic(false)
+ , m_orientation(Horizontal)
+ , m_textOrientation(TextOrientationVerticalRight)
+{
+}
+
+FontPlatformData::FontPlatformData(float textSize, bool fakeBold, bool fakeItalic)
+ : m_typeface(0)
+ , m_textSize(textSize)
+ , m_emSizeInFontUnits(0)
+ , m_fakeBold(fakeBold)
+ , m_fakeItalic(fakeItalic)
+ , m_orientation(Horizontal)
+ , m_textOrientation(TextOrientationVerticalRight)
+{
+}
+
FontPlatformData::FontPlatformData(const FontPlatformData& src)
: m_typeface(src.m_typeface)
, m_family(src.m_family)
Modified: trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h (123585 => 123586)
--- trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h 2012-07-25 08:00:53 UTC (rev 123585)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h 2012-07-25 08:18:59 UTC (rev 123586)
@@ -33,11 +33,6 @@
#include "FontOrientation.h"
#include "FontRenderStyle.h"
-#if USE(HARFBUZZ_NG)
-#include "HarfBuzzNGFace.h"
-#else
-#include "HarfBuzzSkia.h"
-#endif
#include "SkPaint.h"
#include "TextOrientation.h"
#include <wtf/Forward.h>
@@ -52,6 +47,12 @@
class FontDescription;
+#if USE(HARFBUZZ_NG)
+class HarfBuzzNGFace;
+#else
+class HarfbuzzFace;
+#endif
+
// -----------------------------------------------------------------------------
// FontPlatformData is the handle which WebKit has on a specific face. A face
// is the tuple of (font, size, ...etc). Here we are just wrapping a Skia
@@ -64,36 +65,9 @@
// to this "Deleted" one. It expects the Deleted one to be differentiable
// from the 0 one (created with the empty constructor), so we can't just
// set everything to 0.
- FontPlatformData(WTF::HashTableDeletedValueType)
- : m_typeface(hashTableDeletedFontValue())
- , m_textSize(0)
- , m_emSizeInFontUnits(0)
- , m_fakeBold(false)
- , m_fakeItalic(false)
- , m_orientation(Horizontal)
- , m_textOrientation(TextOrientationVerticalRight)
- { }
-
- FontPlatformData()
- : m_typeface(0)
- , m_textSize(0)
- , m_emSizeInFontUnits(0)
- , m_fakeBold(false)
- , m_fakeItalic(false)
- , m_orientation(Horizontal)
- , m_textOrientation(TextOrientationVerticalRight)
- { }
-
- FontPlatformData(float textSize, bool fakeBold, bool fakeItalic)
- : m_typeface(0)
- , m_textSize(textSize)
- , m_emSizeInFontUnits(0)
- , m_fakeBold(fakeBold)
- , m_fakeItalic(fakeItalic)
- , m_orientation(Horizontal)
- , m_textOrientation(TextOrientationVerticalRight)
- { }
-
+ FontPlatformData(WTF::HashTableDeletedValueType);
+ FontPlatformData();
+ FontPlatformData(float textSize, bool fakeBold, bool fakeItalic);
FontPlatformData(const FontPlatformData&);
FontPlatformData(SkTypeface*, const char* name, float textSize, bool fakeBold, bool fakeItalic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight);
FontPlatformData(const FontPlatformData& src, float textSize);
Modified: trunk/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzNGFace.h (123585 => 123586)
--- trunk/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzNGFace.h 2012-07-25 08:00:53 UTC (rev 123585)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzNGFace.h 2012-07-25 08:18:59 UTC (rev 123586)
@@ -31,15 +31,7 @@
#ifndef HarfBuzzNGFace_h
#define HarfBuzzNGFace_h
-#if PLATFORM(CHROMIUM) && OS(DARWIN)
-// TODO: Figure out why including <hb.h> fails on chromium.
-struct _hb_face_t;
-typedef _hb_face_t hb_face_t;
-struct _hb_font_t;
-typedef _hb_font_t hb_font_t;
-#else
#include <hb.h>
-#endif
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>