<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>143758</bug_id>
          
          <creation_ts>2015-04-15 06:19:47 -0700</creation_ts>
          <short_desc>WebCore uses M_PI_2 instead of piOverTwoDouble</short_desc>
          <delta_ts>2015-05-18 23:40:37 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>133028</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="LRN">lrn1986</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cgarcia</cc>
    
    <cc>darin</cc>
    
    <cc>lrn1986</cc>
    
    <cc>mcrha</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1085453</commentid>
    <comment_count>0</comment_count>
    <who name="LRN">lrn1986</who>
    <bug_when>2015-04-15 06:19:47 -0700</bug_when>
    <thetext>This doesn&apos;t work well when M_PI_2 is undefined.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1085526</commentid>
    <comment_count>1</comment_count>
      <attachid>250803</attachid>
    <who name="LRN">lrn1986</who>
    <bug_when>2015-04-15 09:50:27 -0700</bug_when>
    <thetext>Created attachment 250803
Use piOverTwoDouble instead of M_PI_2

Because M_PI_2 is not defined everywhere.
Fixes errors like:
  CXX      Source/WebCore/platform/graphics/freetype/libPlatformGtk_la-FontPlatformDataFreeType.lo
../webkitgtk-2.4.8/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp: In function &apos;void WebCore::rotateCairoMatrixForVerticalOrientation(cairo_matrix_t*)&apos;:
../webkitgtk-2.4.8/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:123:34: error: &apos;M_PI_2&apos; was not declared in this scope
     cairo_matrix_rotate(matrix, -M_PI_2);
                                  ^
GNUmakefile:51663: recipe for target &apos;Source/WebCore/platform/graphics/freetype/libPlatformGtk_la-FontPlatformDataFreeType.lo&apos; failed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1085576</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2015-04-15 10:35:59 -0700</bug_when>
    <thetext>All these patches you uploaded are wrong; they all have No new tests (OOPS!) in them. It was a big mistake to upload tons of patches all at once before you tried one or two and learned how to do them correctly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1086469</commentid>
    <comment_count>3</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2015-04-17 16:10:18 -0700</bug_when>
    <thetext>I do not need this change with webkit-2.4 branch at revision 182543</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1086470</commentid>
    <comment_count>4</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2015-04-17 16:13:27 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; I do not need this change with webkit-2.4 branch at revision 182543

Oops, no, I was wrong, it&apos;s still in use here. I&apos;m sorry for confusion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1086477</commentid>
    <comment_count>5</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2015-04-17 16:40:31 -0700</bug_when>
    <thetext>I also patch the same file with this, to be able to build it in webkit-2.4 branch at revision 182543:

--- webkitgtk-2.4.9.orig/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp	2015-04-08 16:19:51 +0000
+++ webkitgtk-2.4.9/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp	2015-04-08 17:11:16 +0000
@@ -32,6 +32,7 @@
 #include &lt;ft2build.h&gt;
 #include FT_TRUETYPE_TABLES_H
 #include &lt;wtf/text/WTFString.h&gt;
+#include &lt;wtf/MathExtras.h&gt;
 
 #if !PLATFORM(EFL)
 #include &lt;gdk/gdk.h&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1087037</commentid>
    <comment_count>6</comment_count>
    <who name="LRN">lrn1986</who>
    <bug_when>2015-04-21 04:12:08 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; I also patch the same file with this, to be able to build it in webkit-2.4
&gt; branch at revision 182543:
&gt; 
&gt; ---
&gt; webkitgtk-2.4.9.orig/Source/WebCore/platform/graphics/freetype/
&gt; FontPlatformDataFreeType.cpp	2015-04-08 16:19:51 +0000
&gt; +++
&gt; webkitgtk-2.4.9/Source/WebCore/platform/graphics/freetype/
&gt; FontPlatformDataFreeType.cpp	2015-04-08 17:11:16 +0000
&gt; @@ -32,6 +32,7 @@
&gt;  #include &lt;ft2build.h&gt;
&gt;  #include FT_TRUETYPE_TABLES_H
&gt;  #include &lt;wtf/text/WTFString.h&gt;
&gt; +#include &lt;wtf/MathExtras.h&gt;
&gt;  
&gt;  #if !PLATFORM(EFL)
&gt;  #include &lt;gdk/gdk.h&gt;

What error do you get when you compile without this change? Do you apply any other math-related patches (apart from attachment 250803 or its equivalent) that might need this include?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1087045</commentid>
    <comment_count>7</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2015-04-21 06:06:27 -0700</bug_when>
    <thetext>This is all what I apply on top of webkitgtk3 2.4.4, which is mostly applicable on top of webkit-2.4 branch too (some chunks fail due to being applied already in the branch):

https://git.gnome.org/browse/evolution/tree/win32/patches/webkitgtk.patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1087046</commentid>
    <comment_count>8</comment_count>
    <who name="LRN">lrn1986</who>
    <bug_when>2015-04-21 06:26:01 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; This is all what I apply on top of webkitgtk3 2.4.4, which is mostly
&gt; applicable on top of webkit-2.4 branch too (some chunks fail due to being
&gt; applied already in the branch):
&gt; 
&gt; https://git.gnome.org/browse/evolution/tree/win32/patches/webkitgtk.patch

I haven&apos;t asked &quot;what patches are you applying&quot;.

I&apos;ve asked &quot;what error do you get when this particular patch (from https://bugs.webkit.org/show_bug.cgi?id=143758#c5 ) is not applied&quot;?

This should help greatly in pushing these patches upstream.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1087048</commentid>
    <comment_count>9</comment_count>
    <who name="LRN">lrn1986</who>
    <bug_when>2015-04-21 06:48:36 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; This is all what I apply on top of webkitgtk3 2.4.4, which is mostly
&gt; &gt; applicable on top of webkit-2.4 branch too (some chunks fail due to being
&gt; &gt; applied already in the branch):
&gt; &gt; 
&gt; &gt; https://git.gnome.org/browse/evolution/tree/win32/patches/webkitgtk.patch
&gt; 
&gt; I haven&apos;t asked &quot;what patches are you applying&quot;.
&gt; 
&gt; I&apos;ve asked &quot;what error do you get when this particular patch (from
&gt; https://bugs.webkit.org/show_bug.cgi?id=143758#c5 ) is not applied&quot;?
&gt; 
&gt; This should help greatly in pushing these patches upstream.

OK, sorry, that does answer the other half of my question. You don&apos;t seem to add any other math-related patches to FontPlatformDataFreeType, and changes to math headers are minimal. So there must be a codepath that is activated in your build but not in mine. Which brings us back to the first half of the question - what error are you getting?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1087880</commentid>
    <comment_count>10</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2015-04-23 10:41:09 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; &gt; +#include &lt;wtf/MathExtras.h&gt;
&gt; 
&gt; What error do you get when you compile without this change?

Hmm, it builds without it too. I do not know why I added it there, possibly because I prefer explicit includes, than implicit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1087906</commentid>
    <comment_count>11</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2015-04-23 11:56:43 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #6)
&gt; &gt; &gt; +#include &lt;wtf/MathExtras.h&gt;
&gt; &gt; 
&gt; &gt; What error do you get when you compile without this change?
&gt; 
&gt; Hmm, it builds without it too. I do not know why I added it there, possibly
&gt; because I prefer explicit includes, than implicit.

OK. We’d like you to follow our project coding style guideline of not doing explicit includes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1095853</commentid>
    <comment_count>12</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2015-05-18 23:40:37 -0700</bug_when>
    <thetext>Committed to 2.4 http://trac.webkit.org/changeset/184550</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>250803</attachid>
            <date>2015-04-15 09:50:27 -0700</date>
            <delta_ts>2015-04-15 10:35:18 -0700</delta_ts>
            <desc>Use piOverTwoDouble instead of M_PI_2</desc>
            <filename>Use-piOverTwoDouble-instead-of-MPI2.patch</filename>
            <type>text/plain</type>
            <size>3585</size>
            <attacher name="LRN">lrn1986</attacher>
            
              <data encoding="base64">RnJvbSAzYmU2MGI3M2QxMDFhYjNlNDU0YmVmMmQ1ODA4ZGE0ZDA2MWFhMWFlIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/PUQwPUEwPUQxPTgzPUQxPTgxPUQwPUJCPUQw
PUIwPUQwPUJEPTIwPUQwPTk4PUQwPUI2PUQwPUIxPz0KID0/VVRGLTg/cT89RDE9ODM9RDA9QkI9
RDA9QjA9RDE9ODI9RDA9QkU9R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MCBkZWdyZWVzCiAgICAgLy8gYW5kIFQgdHJhbnNsYXRlcyBieSBmb250IHNpemUgdG93YXJkcyB5
IGF4aXMuCi0gICAgY2Fpcm9fbWF0cml4X3JvdGF0ZShtYXRyaXgsIC1NX1BJXzIpOworICAgIGNh
aXJvX21hdHJpeF9yb3RhdGUobWF0cml4LCAtcGlPdmVyVHdvRG91YmxlKTsKICAgICBjYWlyb19t
YXRyaXhfdHJhbnNsYXRlKG1hdHJpeCwgMC4wLCAxLjApOwogfQogCi0tIAoxLjguNS4z
</data>
<flag name="review"
          id="275598"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>