Title: [116549] trunk/Source/WebCore
Revision
116549
Author
[email protected]
Date
2012-05-09 12:36:05 -0700 (Wed, 09 May 2012)

Log Message

Fix performance regression for floats caused by LayoutUnit change
https://bugs.webkit.org/show_bug.cgi?id=85834

Reviewed by Ojan Vafai.

Refactoring FractionalLayout types to alleviate performance issues. Explicitly
inlining constructor and operator functions in FractionalLayoutUnit, as well as
pixelSnappedIntSize and pixelSnappedIntRect (particularly hot code paths). Also
further simplifying round and ceil functions when sub-pixel layout is not enabled.

pixelSnappedIntSize was the only function defined in FractionalLayoutSize.cpp,
so it is removed.

No new tests. No change in functionality.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* platform/FractionalLayoutUnit.h:
(WebCore::FractionalLayoutUnit::FractionalLayoutUnit):
(FractionalLayoutUnit):
(WebCore::FractionalLayoutUnit::toInt):
(WebCore::FractionalLayoutUnit::toFloat):
(WebCore::FractionalLayoutUnit::toDouble):
(WebCore::FractionalLayoutUnit::toUnsigned):
(WebCore::FractionalLayoutUnit::operator int):
(WebCore::FractionalLayoutUnit::operator unsigned):
(WebCore::FractionalLayoutUnit::operator float):
(WebCore::FractionalLayoutUnit::operator double):
(WebCore::FractionalLayoutUnit::operator bool):
(WebCore::FractionalLayoutUnit::ceil):
(WebCore::FractionalLayoutUnit::round):
* platform/graphics/FractionalLayoutRect.cpp:
(WebCore):
* platform/graphics/FractionalLayoutRect.h:
(WebCore::FractionalLayoutRect::pixelSnappedSize):
(WebCore::pixelSnappedIntRect):
(WebCore):
* platform/graphics/FractionalLayoutSize.cpp: Removed.
* platform/graphics/FractionalLayoutSize.h:
(WebCore):
* rendering/LayoutTypes.h:
(WebCore::pixelSnappedIntSize):
(WebCore):

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (116548 => 116549)


--- trunk/Source/WebCore/CMakeLists.txt	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/CMakeLists.txt	2012-05-09 19:36:05 UTC (rev 116549)
@@ -1157,7 +1157,6 @@
     platform/graphics/FontFastPath.cpp
     platform/graphics/FontFeatureSettings.cpp
     platform/graphics/FractionalLayoutRect.cpp
-    platform/graphics/FractionalLayoutSize.cpp  
     platform/graphics/GeneratorGeneratedImage.cpp
     platform/graphics/GlyphPageTreeNode.cpp
     platform/graphics/Gradient.cpp

Modified: trunk/Source/WebCore/ChangeLog (116548 => 116549)


--- trunk/Source/WebCore/ChangeLog	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/ChangeLog	2012-05-09 19:36:05 UTC (rev 116549)
@@ -1,3 +1,53 @@
+2012-05-09  Levi Weintraub  <[email protected]>
+
+        Fix performance regression for floats caused by LayoutUnit change
+        https://bugs.webkit.org/show_bug.cgi?id=85834
+
+        Reviewed by Ojan Vafai.
+
+        Refactoring FractionalLayout types to alleviate performance issues. Explicitly
+        inlining constructor and operator functions in FractionalLayoutUnit, as well as
+        pixelSnappedIntSize and pixelSnappedIntRect (particularly hot code paths). Also
+        further simplifying round and ceil functions when sub-pixel layout is not enabled.
+
+        pixelSnappedIntSize was the only function defined in FractionalLayoutSize.cpp,
+        so it is removed.
+
+        No new tests. No change in functionality.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/FractionalLayoutUnit.h:
+        (WebCore::FractionalLayoutUnit::FractionalLayoutUnit):
+        (FractionalLayoutUnit):
+        (WebCore::FractionalLayoutUnit::toInt):
+        (WebCore::FractionalLayoutUnit::toFloat):
+        (WebCore::FractionalLayoutUnit::toDouble):
+        (WebCore::FractionalLayoutUnit::toUnsigned):
+        (WebCore::FractionalLayoutUnit::operator int):
+        (WebCore::FractionalLayoutUnit::operator unsigned):
+        (WebCore::FractionalLayoutUnit::operator float):
+        (WebCore::FractionalLayoutUnit::operator double):
+        (WebCore::FractionalLayoutUnit::operator bool):
+        (WebCore::FractionalLayoutUnit::ceil):
+        (WebCore::FractionalLayoutUnit::round):
+        * platform/graphics/FractionalLayoutRect.cpp:
+        (WebCore):
+        * platform/graphics/FractionalLayoutRect.h:
+        (WebCore::FractionalLayoutRect::pixelSnappedSize):
+        (WebCore::pixelSnappedIntRect):
+        (WebCore):
+        * platform/graphics/FractionalLayoutSize.cpp: Removed.
+        * platform/graphics/FractionalLayoutSize.h:
+        (WebCore):
+        * rendering/LayoutTypes.h:
+        (WebCore::pixelSnappedIntSize):
+        (WebCore):
+
 2012-05-09  Abhishek Arya  <[email protected]>
 
         Crash in ReplaceSelectionCommand::performTrivialReplace

Modified: trunk/Source/WebCore/GNUmakefile.list.am (116548 => 116549)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-05-09 19:36:05 UTC (rev 116549)
@@ -3252,7 +3252,6 @@
 	Source/WebCore/platform/graphics/FractionalLayoutPoint.h \
 	Source/WebCore/platform/graphics/FractionalLayoutRect.cpp \
 	Source/WebCore/platform/graphics/FractionalLayoutRect.h \
-	Source/WebCore/platform/graphics/FractionalLayoutSize.cpp \
 	Source/WebCore/platform/graphics/FractionalLayoutSize.h \
 	Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp \
 	Source/WebCore/platform/graphics/GeneratorGeneratedImage.h \

Modified: trunk/Source/WebCore/Target.pri (116548 => 116549)


--- trunk/Source/WebCore/Target.pri	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/Target.pri	2012-05-09 19:36:05 UTC (rev 116549)
@@ -1103,7 +1103,6 @@
     platform/graphics/Font.cpp \
     platform/graphics/FontCache.cpp \
     platform/graphics/FractionalLayoutRect.cpp \
-    platform/graphics/FractionalLayoutSize.cpp \
     platform/graphics/GeneratorGeneratedImage.cpp \
     platform/graphics/Gradient.cpp \
     platform/graphics/GraphicsContext.cpp \

Modified: trunk/Source/WebCore/WebCore.exp.in (116548 => 116549)


--- trunk/Source/WebCore/WebCore.exp.in	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/WebCore.exp.in	2012-05-09 19:36:05 UTC (rev 116549)
@@ -607,7 +607,6 @@
 __ZN7WebCore19TextResourceDecoderC1ERKN3WTF6StringERKNS_12TextEncodingEb
 __ZN7WebCore19TextResourceDecoderD1Ev
 __ZN7WebCore19applicationIsSafariEv
-__ZN7WebCore19pixelSnappedIntRectERKNS_20FractionalLayoutRectE
 __ZN7WebCore20DictationAlternativeC1Ejjy
 __ZN7WebCore20DictationAlternativeC1Ev
 __ZN7WebCore20DisplaySleepDisablerC1EPKc
@@ -940,6 +939,7 @@
 __ZN7WebCore7IntRect5scaleEf
 __ZN7WebCore7IntRect5uniteERKS0_
 __ZN7WebCore7IntRect9intersectERKS0_
+__ZN7WebCore7IntRectC1ERKNS_20FractionalLayoutRectE
 __ZN7WebCore7IntRectC1ERKNS_9FloatRectE
 __ZN7WebCore7IntSizeC1ERK6CGSize
 __ZN7WebCore7RunLoop14runForDurationEd

Modified: trunk/Source/WebCore/WebCore.gypi (116548 => 116549)


--- trunk/Source/WebCore/WebCore.gypi	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/WebCore.gypi	2012-05-09 19:36:05 UTC (rev 116549)
@@ -3403,7 +3403,6 @@
             'platform/graphics/CrossfadeGeneratedImage.cpp',
             'platform/graphics/CrossfadeGeneratedImage.h',
             'platform/graphics/Extensions3D.h',
-            'platform/graphics/FractionalLayoutSize.cpp',
             'platform/graphics/FloatPoint.cpp',
             'platform/graphics/FloatPoint3D.cpp',
             'platform/graphics/FloatQuad.cpp',
@@ -3420,7 +3419,6 @@
             'platform/graphics/FontPlatformData.cpp',
             'platform/graphics/FontPlatformData.h',
             'platform/graphics/FractionalLayoutRect.cpp',
-            'platform/graphics/FractionalLayoutSize.cpp',
             'platform/graphics/GeneratorGeneratedImage.cpp',
             'platform/graphics/GeneratedImage.h',
             'platform/graphics/GlyphPageTreeNode.cpp',

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (116548 => 116549)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-05-09 19:36:05 UTC (rev 116549)
@@ -28829,10 +28829,6 @@
 					>
 				</File>
 				<File
-					RelativePath="..\platform\graphics\FractionalLayoutSize.cpp"
-					>
-				</File>
-				<File
 					RelativePath="..\platform\graphics\FractionalLayoutSize.h"
 					>
 				</File>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (116548 => 116549)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-05-09 19:36:05 UTC (rev 116549)
@@ -295,7 +295,6 @@
 		1449E24C107D4A8400B5793F /* JSCallbackData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1449E24A107D4A8400B5793F /* JSCallbackData.h */; };
 		1449E287107D4DB400B5793F /* JSCallbackData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1449E286107D4DB400B5793F /* JSCallbackData.cpp */; };
 		144FCE5214EC79BC000D17A3 /* FractionalLayoutUnit.h in Headers */ = {isa = PBXBuildFile; fileRef = 144FCE5114EC79BC000D17A3 /* FractionalLayoutUnit.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		144FCE5C14EC79E7000D17A3 /* FractionalLayoutSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 144FCE5714EC79E7000D17A3 /* FractionalLayoutSize.cpp */; };
 		144FCE5D14EC79E7000D17A3 /* FractionalLayoutSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 144FCE5814EC79E7000D17A3 /* FractionalLayoutSize.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		144FCFE014EF2509000D17A3 /* FractionalLayoutRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 144FCFDE14EF2509000D17A3 /* FractionalLayoutRect.cpp */; };
 		144FCFE114EF2509000D17A3 /* FractionalLayoutRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 144FCFDF14EF2509000D17A3 /* FractionalLayoutRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -7171,7 +7170,6 @@
 		1449E286107D4DB400B5793F /* JSCallbackData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCallbackData.cpp; sourceTree = "<group>"; };
 		144FCE5114EC79BC000D17A3 /* FractionalLayoutUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FractionalLayoutUnit.h; sourceTree = "<group>"; };
 		144FCE5414EC79E7000D17A3 /* FractionalLayoutPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FractionalLayoutPoint.h; sourceTree = "<group>"; };
-		144FCE5714EC79E7000D17A3 /* FractionalLayoutSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FractionalLayoutSize.cpp; sourceTree = "<group>"; };
 		144FCE5814EC79E7000D17A3 /* FractionalLayoutSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FractionalLayoutSize.h; sourceTree = "<group>"; };
 		144FCFDE14EF2509000D17A3 /* FractionalLayoutRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FractionalLayoutRect.cpp; sourceTree = "<group>"; };
 		144FCFDF14EF2509000D17A3 /* FractionalLayoutRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FractionalLayoutRect.h; sourceTree = "<group>"; };
@@ -19399,7 +19397,6 @@
 				144FCE5414EC79E7000D17A3 /* FractionalLayoutPoint.h */,
 				144FCFDE14EF2509000D17A3 /* FractionalLayoutRect.cpp */,
 				144FCFDF14EF2509000D17A3 /* FractionalLayoutRect.h */,
-				144FCE5714EC79E7000D17A3 /* FractionalLayoutSize.cpp */,
 				144FCE5814EC79E7000D17A3 /* FractionalLayoutSize.h */,
 				BC23F0DA0DAFF4A4009FDC91 /* GeneratedImage.h */,
 				BCE04C890DAFF7A0007A0F41 /* Generator.h */,
@@ -26007,7 +26004,6 @@
 				656D373B0ADBA5DE00A4554D /* FormState.cpp in Sources */,
 				41885B9411B6FDA6003383BB /* FormSubmission.cpp in Sources */,
 				144FCFE014EF2509000D17A3 /* FractionalLayoutRect.cpp in Sources */,
-				144FCE5C14EC79E7000D17A3 /* FractionalLayoutSize.cpp in Sources */,
 				65BF022E0974816300C43196 /* Frame.cpp in Sources */,
 				A7B070D2130A409C00A3763C /* FrameActionScheduler.cpp in Sources */,
 				974A862214B7ADBB003FDC76 /* FrameDestructionObserver.cpp in Sources */,

Modified: trunk/Source/WebCore/platform/FractionalLayoutUnit.h (116548 => 116549)


--- trunk/Source/WebCore/platform/FractionalLayoutUnit.h	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/platform/FractionalLayoutUnit.h	2012-05-09 19:36:05 UTC (rev 116549)
@@ -66,24 +66,38 @@
     // However due to compiler and platform differences adding those are non-trivial.
     // See https://bugs.webkit.org/show_bug.cgi?id=83848 for details.
     
-    FractionalLayoutUnit() : m_value(0) { }
-    FractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
-    FractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
-    FractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
-    FractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
-    FractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
-    FractionalLayoutUnit(const FractionalLayoutUnit& value) { m_value = value.rawValue(); }
+    inline FractionalLayoutUnit() : m_value(0) { }
+#if ENABLE(SUBPIXEL_LAYOUT)
+    inline FractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
+    inline FractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
+    inline FractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
+    inline FractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
+    inline FractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
+#else
+    inline FractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
+    inline FractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
+    inline FractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
+    inline FractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
+    inline FractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
+#endif
+    inline FractionalLayoutUnit(const FractionalLayoutUnit& value) { m_value = value.rawValue(); }
 
+#if ENABLE(SUBPIXEL_LAYOUT)
     inline int toInt() const { return m_value / kFixedPointDenominator; }
-    inline unsigned toUnsigned() const { REPORT_OVERFLOW(m_value >= 0); return toInt(); }
     inline float toFloat() const { return static_cast<float>(m_value) / kFixedPointDenominator; }
     inline double toDouble() const { return static_cast<double>(m_value) / kFixedPointDenominator; }
+#else
+    inline int toInt() const { return m_value; }
+    inline float toFloat() const { return static_cast<float>(m_value); }
+    inline double toDouble() const { return static_cast<double>(m_value); }
+#endif
+    inline unsigned toUnsigned() const { REPORT_OVERFLOW(m_value >= 0); return toInt(); }
 
-    operator int() const { return toInt(); }
-    operator unsigned() const { return toUnsigned(); }
-    operator float() const { return toFloat(); }
-    operator double() const { return toDouble(); }
-    operator bool() const { return m_value; }
+    inline operator int() const { return toInt(); }
+    inline operator unsigned() const { return toUnsigned(); }
+    inline operator float() const { return toFloat(); }
+    inline operator double() const { return toDouble(); }
+    inline operator bool() const { return m_value; }
 
     inline FractionalLayoutUnit operator++(int)
     {
@@ -111,15 +125,23 @@
     inline int ceil() const
 #endif
     {
+#if ENABLE(SUBPIXEL_LAYOUT)
         if (m_value > 0)
             return (m_value + kFixedPointDenominator - 1) / kFixedPointDenominator;
         return (m_value - kFixedPointDenominator + 1) / kFixedPointDenominator;
+#else
+        return m_value;
+#endif
     }
     inline int round() const
     {
+#if ENABLE(SUBPIXEL_LAYOUT)
         if (m_value > 0)
             return (m_value + (kFixedPointDenominator / 2)) / kFixedPointDenominator;
         return (m_value - (kFixedPointDenominator / 2)) / kFixedPointDenominator;
+#else
+        return m_value;
+#endif
     }
 
     inline int floor() const

Modified: trunk/Source/WebCore/platform/graphics/FractionalLayoutRect.cpp (116548 => 116549)


--- trunk/Source/WebCore/platform/graphics/FractionalLayoutRect.cpp	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/platform/graphics/FractionalLayoutRect.cpp	2012-05-09 19:36:05 UTC (rev 116549)
@@ -148,11 +148,4 @@
 #endif
 }
 
-IntRect pixelSnappedIntRect(const FractionalLayoutRect& rect)
-{
-    IntPoint roundedLocation = roundedIntPoint(rect.location());
-    return IntRect(roundedLocation, IntSize((rect.x() + rect.width()).round() - roundedLocation.x(),
-                                            (rect.y() + rect.height()).round() - roundedLocation.y()));
-}
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/FractionalLayoutRect.h (116548 => 116549)


--- trunk/Source/WebCore/platform/graphics/FractionalLayoutRect.h	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/platform/graphics/FractionalLayoutRect.h	2012-05-09 19:36:05 UTC (rev 116549)
@@ -56,7 +56,7 @@
     FractionalLayoutSize size() const { return m_size; }
 
     IntPoint pixelSnappedLocation() const { return roundedIntPoint(m_location); }
-    IntSize pixelSnappedSize() const { return pixelSnappedIntSize(m_size, m_location); }
+    IntSize pixelSnappedSize() const { return IntSize(snapSizeToPixel(m_size.width(), m_location.x()), snapSizeToPixel(m_size.height(), m_location.y())); }
 
     void setLocation(const FractionalLayoutPoint& location) { m_location = location; }
     void setSize(const FractionalLayoutSize& size) { m_size = size; }
@@ -184,9 +184,19 @@
     return a.location() != b.location() || a.size() != b.size();
 }
 
+inline IntRect pixelSnappedIntRect(const FractionalLayoutRect& rect)
+{
+#if ENABLE(SUBPIXEL_LAYOUT)
+    IntPoint roundedLocation = roundedIntPoint(rect.location());
+    return IntRect(roundedLocation, IntSize((rect.x() + rect.width()).round() - roundedLocation.x(),
+                                            (rect.y() + rect.height()).round() - roundedLocation.y()));
+#else
+    return IntRect(rect);
+#endif
+}
+
 IntRect enclosingIntRect(const FractionalLayoutRect&);
 FractionalLayoutRect enclosingFractionalLayoutRect(const FloatRect&);
-IntRect pixelSnappedIntRect(const FractionalLayoutRect&);
 
 } // namespace WebCore
 

Deleted: trunk/Source/WebCore/platform/graphics/FractionalLayoutSize.cpp (116548 => 116549)


--- trunk/Source/WebCore/platform/graphics/FractionalLayoutSize.cpp	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/platform/graphics/FractionalLayoutSize.cpp	2012-05-09 19:36:05 UTC (rev 116549)
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2012, 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 "FractionalLayoutSize.h"
-
-#include "FractionalLayoutPoint.h"
-
-namespace WebCore {
-
-IntSize pixelSnappedIntSize(const FractionalLayoutSize& s, const FractionalLayoutPoint& p)
-{
-    return IntSize(snapSizeToPixel(s.width(), p.x()), snapSizeToPixel(s.height(), p.y()));
-}
-
-} // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/FractionalLayoutSize.h (116548 => 116549)


--- trunk/Source/WebCore/platform/graphics/FractionalLayoutSize.h	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/platform/graphics/FractionalLayoutSize.h	2012-05-09 19:36:05 UTC (rev 116549)
@@ -145,8 +145,6 @@
     return IntSize(s.width().round(), s.height().round());
 }
 
-IntSize pixelSnappedIntSize(const FractionalLayoutSize&, const FractionalLayoutPoint&);
-
 } // namespace WebCore
 
 #endif // FractionalLayoutSize_h

Modified: trunk/Source/WebCore/rendering/LayoutTypes.h (116548 => 116549)


--- trunk/Source/WebCore/rendering/LayoutTypes.h	2012-05-09 19:01:03 UTC (rev 116548)
+++ trunk/Source/WebCore/rendering/LayoutTypes.h	2012-05-09 19:36:05 UTC (rev 116549)
@@ -155,6 +155,11 @@
     return clampTo<FractionalLayoutUnit>(value, FractionalLayoutUnit::min(), FractionalLayoutUnit::max());
 }
 
+inline IntSize pixelSnappedIntSize(const FractionalLayoutSize& s, const FractionalLayoutPoint& p)
+{
+    return IntSize(snapSizeToPixel(s.width(), p.x()), snapSizeToPixel(s.height(), p.y()));
+}
+
 inline IntRect pixelSnappedIntRect(LayoutPoint location, LayoutSize size)
 {
     return IntRect(roundedIntPoint(location), pixelSnappedIntSize(size, location));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to