Changeset 116905 in webkit


Ignore:
Timestamp:
May 13, 2012 4:36:03 PM (12 years ago)
Author:
Darin Adler
Message:

FractionalLayoutUnit class has unneeded redundant uses of "inline" keyword
https://bugs.webkit.org/show_bug.cgi?id=86301

Reviewed by Andreas Kling.

  • platform/FractionalLayoutUnit.h: Removed uses of inline for functions

defined inside a class definition. The C++ language defines that all such
functions are treated as if specified with inline, and explicitly stating
inline in addition does not add anything or change behavior.

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116904 r116905  
     12012-05-13  Darin Adler  <darin@apple.com>
     2
     3        FractionalLayoutUnit class has unneeded redundant uses of "inline" keyword
     4        https://bugs.webkit.org/show_bug.cgi?id=86301
     5
     6        Reviewed by Andreas Kling.
     7
     8        * platform/FractionalLayoutUnit.h: Removed uses of inline for functions
     9        defined inside a class definition. The C++ language defines that all such
     10        functions are treated as if specified with inline, and explicitly stating
     11        inline in addition does not add anything or change behavior.
     12
    1132012-05-13  Darin Adler  <darin@apple.com>
    214
  • trunk/Source/WebCore/platform/FractionalLayoutUnit.h

    r116767 r116905  
    7171    // See https://bugs.webkit.org/show_bug.cgi?id=83848 for details.
    7272   
    73     inline FractionalLayoutUnit() : m_value(0) { }
    74 #if ENABLE(SUBPIXEL_LAYOUT)
    75     inline FractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
    76     inline FractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
    77     inline FractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
    78     inline FractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
    79     inline FractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
    80 #else
    81     inline FractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
    82     inline FractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
    83     inline FractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
    84     inline FractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
    85     inline FractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
    86 #endif
    87     inline FractionalLayoutUnit(const FractionalLayoutUnit& value) { m_value = value.rawValue(); }
    88 
    89 #if ENABLE(SUBPIXEL_LAYOUT)
    90     inline int toInt() const { return m_value / kFixedPointDenominator; }
    91     inline float toFloat() const { return static_cast<float>(m_value) / kFixedPointDenominator; }
    92     inline double toDouble() const { return static_cast<double>(m_value) / kFixedPointDenominator; }
    93 #else
    94     inline int toInt() const { return m_value; }
    95     inline float toFloat() const { return static_cast<float>(m_value); }
    96     inline double toDouble() const { return static_cast<double>(m_value); }
    97 #endif
    98     inline unsigned toUnsigned() const { REPORT_OVERFLOW(m_value >= 0); return toInt(); }
    99 
    100     inline operator int() const { return toInt(); }
    101     inline operator unsigned() const { return toUnsigned(); }
    102     inline operator float() const { return toFloat(); }
    103     inline operator double() const { return toDouble(); }
    104     inline operator bool() const { return m_value; }
    105 
    106     inline FractionalLayoutUnit operator++(int)
     73    FractionalLayoutUnit() : m_value(0) { }
     74#if ENABLE(SUBPIXEL_LAYOUT)
     75    FractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
     76    FractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
     77    FractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
     78    FractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
     79    FractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }
     80#else
     81    FractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
     82    FractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
     83    FractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
     84    FractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
     85    FractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }
     86#endif
     87    FractionalLayoutUnit(const FractionalLayoutUnit& value) { m_value = value.rawValue(); }
     88
     89#if ENABLE(SUBPIXEL_LAYOUT)
     90    int toInt() const { return m_value / kFixedPointDenominator; }
     91    float toFloat() const { return static_cast<float>(m_value) / kFixedPointDenominator; }
     92    double toDouble() const { return static_cast<double>(m_value) / kFixedPointDenominator; }
     93#else
     94    int toInt() const { return m_value; }
     95    float toFloat() const { return static_cast<float>(m_value); }
     96    double toDouble() const { return static_cast<double>(m_value); }
     97#endif
     98    unsigned toUnsigned() const { REPORT_OVERFLOW(m_value >= 0); return toInt(); }
     99
     100    operator int() const { return toInt(); }
     101    operator unsigned() const { return toUnsigned(); }
     102    operator float() const { return toFloat(); }
     103    operator double() const { return toDouble(); }
     104    operator bool() const { return m_value; }
     105
     106    FractionalLayoutUnit operator++(int)
    107107    {
    108108        m_value += kFixedPointDenominator;
     
    110110    }
    111111
    112     inline int rawValue() const { return m_value; }
    113     inline void setRawValue(int value) { m_value = value; }
    114     inline void setRawValue(long long value)
     112    int rawValue() const { return m_value; }
     113    void setRawValue(int value) { m_value = value; }
     114    void setRawValue(long long value)
    115115    {
    116116        REPORT_OVERFLOW(value > std::numeric_limits<int>::min() && value < std::numeric_limits<int>::max());
     
    118118    }
    119119
    120     inline FractionalLayoutUnit abs() const
     120    FractionalLayoutUnit abs() const
    121121    {
    122122        FractionalLayoutUnit returnValue;
     
    125125    }
    126126#if OS(DARWIN)
    127     inline int wtf_ceil() const
    128 #else
    129     inline int ceil() const
     127    int wtf_ceil() const
     128#else
     129    int ceil() const
    130130#endif
    131131    {
     
    138138#endif
    139139    }
    140     inline int round() const
     140    int round() const
    141141    {
    142142#if ENABLE(SUBPIXEL_LAYOUT)
     
    149149    }
    150150
    151     inline int floor() const
     151    int floor() const
    152152    {
    153153        return toInt();
     
    169169   
    170170private:
    171     inline bool isInBounds(int value)
     171    bool isInBounds(int value)
    172172    {
    173173        return ::abs(value) <= std::numeric_limits<int>::max() / kFixedPointDenominator;
    174174    }
    175     inline bool isInBounds(unsigned value)
     175    bool isInBounds(unsigned value)
    176176    {
    177177        return value <= static_cast<unsigned>(std::numeric_limits<int>::max()) / kFixedPointDenominator;
    178178    }
    179     inline bool isInBounds(double value)
     179    bool isInBounds(double value)
    180180    {
    181181        return ::fabs(value) <= std::numeric_limits<int>::max() / kFixedPointDenominator;
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.h

    r113486 r116905  
    263263        void drawPath(const Path&);
    264264
    265         void drawNativeImage(NativeImagePtr, const FloatSize& selfSize, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, ImageOrientation = DefaultImageOrientation);
     265        void drawNativeImage(CGImageRef, const FloatSize& selfSize, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, ImageOrientation = DefaultImageOrientation);
    266266
    267267        // Allow font smoothing (LCD antialiasing). Not part of the graphics state.
  • trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp

    r114548 r116905  
    7575
    7676namespace WebCore {
     77
     78static RetainPtr<CGImageRef> subimage(CGImageRef image, const FloatRect& rect)
     79{
     80    return adoptCF(CGImageCreateWithImageInRect(image, rect));
     81}
    7782   
    7883static CGColorSpaceRef createLinearSRGBColorSpace()
     
    213218            adjustedDestRect.setHeight(subimageRect.height() / yScale);
    214219
    215             image.adoptCF(CGImageCreateWithImageInRect(image.get(), subimageRect));
     220            image = subimage(image.get(), subimageRect);
    216221            if (currHeight < srcRect.maxY()) {
    217222                ASSERT(CGImageGetHeight(image.get()) == currHeight - CGRectIntegral(srcRect).origin.y);
  • trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp

    r113486 r116905  
    195195    startAnimation();
    196196
    197     RetainPtr<CGImageRef> image = frameAtIndex(m_currentFrame);
     197    CGImageRef image = frameAtIndex(m_currentFrame);
    198198    if (!image) // If it's too early we won't have an image yet.
    199199        return;
     
    210210        orientation = frameOrientationAtIndex(m_currentFrame);
    211211
    212     ctxt->drawNativeImage(image.get(), selfSize, styleColorSpace, destRect, srcRect, compositeOp, orientation);
     212    ctxt->drawNativeImage(image, selfSize, styleColorSpace, destRect, srcRect, compositeOp, orientation);
    213213
    214214    if (imageObserver())
Note: See TracChangeset for help on using the changeset viewer.