Remove constructors and operators of FontPlatformData defined only for Freetype
authorannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Aug 2019 10:20:48 +0000 (10:20 +0000)
committerannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Aug 2019 10:20:48 +0000 (10:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200379

Reviewed by Carlos Garcia Campos.

These methods only make maintenance harder, as all data fields are
trivially copyable. Constructors generated by compiler should be used
instead.

* platform/graphics/FontPlatformData.h:
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248152 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FontPlatformData.h
Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp

index 69d11cd..f6e087c 100644 (file)
@@ -1,5 +1,19 @@
 2019-08-02  Konstantin Tokarev  <annulen@yandex.ru>
 
+        Remove constructors and operators of FontPlatformData defined only for Freetype
+        https://bugs.webkit.org/show_bug.cgi?id=200379
+
+        Reviewed by Carlos Garcia Campos.
+
+        These methods only make maintenance harder, as all data fields are
+        trivially copyable. Constructors generated by compiler should be used
+        instead.
+
+        * platform/graphics/FontPlatformData.h:
+        * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
+
+2019-08-02  Konstantin Tokarev  <annulen@yandex.ru>
+
         Remove unused constructor declaration from FontPlatformData
         https://bugs.webkit.org/show_bug.cgi?id=200371
 
index 4a6648e..0f03cff 100644 (file)
@@ -112,11 +112,6 @@ public:
 
 #if USE(FREETYPE)
     FontPlatformData(cairo_font_face_t*, FcPattern*, float size, bool fixedWidth, bool syntheticBold, bool syntheticOblique, FontOrientation);
-    FontPlatformData(const FontPlatformData&);
-    FontPlatformData(FontPlatformData&&) = default;
-    FontPlatformData& operator=(const FontPlatformData&);
-    FontPlatformData& operator=(FontPlatformData&&) = default;
-    ~FontPlatformData();
 #endif
 
 #if PLATFORM(WIN)
index bcf6754..7357263 100644 (file)
@@ -126,38 +126,6 @@ FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, FcPattern* patte
 #endif
 }
 
-FontPlatformData::FontPlatformData(const FontPlatformData& other)
-{
-    *this = other;
-}
-
-FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
-{
-    // Check for self-assignment.
-    if (this == &other)
-        return *this;
-
-    m_size = other.m_size;
-    m_orientation = other.m_orientation;
-    m_widthVariant = other.m_widthVariant;
-    m_textRenderingMode = other.m_textRenderingMode;
-
-    m_syntheticBold = other.m_syntheticBold;
-    m_syntheticOblique = other.m_syntheticOblique;
-    m_isColorBitmapFont = other.m_isColorBitmapFont;
-    m_isHashTableDeletedValue = other.m_isHashTableDeletedValue;
-    m_isSystemFont = other.m_isSystemFont;
-
-    m_fixedWidth = other.m_fixedWidth;
-    m_pattern = other.m_pattern;
-
-    m_scaledFont = other.m_scaledFont;
-
-    return *this;
-}
-
-FontPlatformData::~FontPlatformData() = default;
-
 FontPlatformData FontPlatformData::cloneWithOrientation(const FontPlatformData& source, FontOrientation orientation)
 {
     FontPlatformData copy(source);