Changeset 116905 in webkit
- Timestamp:
- May 13, 2012 4:36:03 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116904 r116905 1 2012-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 1 13 2012-05-13 Darin Adler <darin@apple.com> 2 14 -
trunk/Source/WebCore/platform/FractionalLayoutUnit.h
r116767 r116905 71 71 // See https://bugs.webkit.org/show_bug.cgi?id=83848 for details. 72 72 73 inlineFractionalLayoutUnit() : m_value(0) { }74 #if ENABLE(SUBPIXEL_LAYOUT) 75 inlineFractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }76 inlineFractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }77 inlineFractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }78 inlineFractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }79 inlineFractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value * kFixedPointDenominator; }80 #else 81 inlineFractionalLayoutUnit(int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }82 inlineFractionalLayoutUnit(unsigned short value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }83 inlineFractionalLayoutUnit(unsigned int value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }84 inlineFractionalLayoutUnit(float value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }85 inlineFractionalLayoutUnit(double value) { REPORT_OVERFLOW(isInBounds(value)); m_value = value; }86 #endif 87 inlineFractionalLayoutUnit(const FractionalLayoutUnit& value) { m_value = value.rawValue(); }88 89 #if ENABLE(SUBPIXEL_LAYOUT) 90 in line int toInt() const { return m_value / kFixedPointDenominator; }91 inlinefloat toFloat() const { return static_cast<float>(m_value) / kFixedPointDenominator; }92 inlinedouble toDouble() const { return static_cast<double>(m_value) / kFixedPointDenominator; }93 #else 94 in line int toInt() const { return m_value; }95 inlinefloat toFloat() const { return static_cast<float>(m_value); }96 inlinedouble toDouble() const { return static_cast<double>(m_value); }97 #endif 98 inlineunsigned toUnsigned() const { REPORT_OVERFLOW(m_value >= 0); return toInt(); }99 100 inlineoperator int() const { return toInt(); }101 inlineoperator unsigned() const { return toUnsigned(); }102 inlineoperator float() const { return toFloat(); }103 inlineoperator double() const { return toDouble(); }104 inlineoperator bool() const { return m_value; }105 106 inlineFractionalLayoutUnit 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) 107 107 { 108 108 m_value += kFixedPointDenominator; … … 110 110 } 111 111 112 in line int rawValue() const { return m_value; }113 inlinevoid setRawValue(int value) { m_value = value; }114 inlinevoid 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) 115 115 { 116 116 REPORT_OVERFLOW(value > std::numeric_limits<int>::min() && value < std::numeric_limits<int>::max()); … … 118 118 } 119 119 120 inlineFractionalLayoutUnit abs() const120 FractionalLayoutUnit abs() const 121 121 { 122 122 FractionalLayoutUnit returnValue; … … 125 125 } 126 126 #if OS(DARWIN) 127 in line int wtf_ceil() const128 #else 129 in line int ceil() const127 int wtf_ceil() const 128 #else 129 int ceil() const 130 130 #endif 131 131 { … … 138 138 #endif 139 139 } 140 in line int round() const140 int round() const 141 141 { 142 142 #if ENABLE(SUBPIXEL_LAYOUT) … … 149 149 } 150 150 151 in line int floor() const151 int floor() const 152 152 { 153 153 return toInt(); … … 169 169 170 170 private: 171 inlinebool isInBounds(int value)171 bool isInBounds(int value) 172 172 { 173 173 return ::abs(value) <= std::numeric_limits<int>::max() / kFixedPointDenominator; 174 174 } 175 inlinebool isInBounds(unsigned value)175 bool isInBounds(unsigned value) 176 176 { 177 177 return value <= static_cast<unsigned>(std::numeric_limits<int>::max()) / kFixedPointDenominator; 178 178 } 179 inlinebool isInBounds(double value)179 bool isInBounds(double value) 180 180 { 181 181 return ::fabs(value) <= std::numeric_limits<int>::max() / kFixedPointDenominator; -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r113486 r116905 263 263 void drawPath(const Path&); 264 264 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); 266 266 267 267 // Allow font smoothing (LCD antialiasing). Not part of the graphics state. -
trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
r114548 r116905 75 75 76 76 namespace WebCore { 77 78 static RetainPtr<CGImageRef> subimage(CGImageRef image, const FloatRect& rect) 79 { 80 return adoptCF(CGImageCreateWithImageInRect(image, rect)); 81 } 77 82 78 83 static CGColorSpaceRef createLinearSRGBColorSpace() … … 213 218 adjustedDestRect.setHeight(subimageRect.height() / yScale); 214 219 215 image .adoptCF(CGImageCreateWithImageInRect(image.get(), subimageRect));220 image = subimage(image.get(), subimageRect); 216 221 if (currHeight < srcRect.maxY()) { 217 222 ASSERT(CGImageGetHeight(image.get()) == currHeight - CGRectIntegral(srcRect).origin.y); -
trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp
r113486 r116905 195 195 startAnimation(); 196 196 197 RetainPtr<CGImageRef>image = frameAtIndex(m_currentFrame);197 CGImageRef image = frameAtIndex(m_currentFrame); 198 198 if (!image) // If it's too early we won't have an image yet. 199 199 return; … … 210 210 orientation = frameOrientationAtIndex(m_currentFrame); 211 211 212 ctxt->drawNativeImage(image .get(), selfSize, styleColorSpace, destRect, srcRect, compositeOp, orientation);212 ctxt->drawNativeImage(image, selfSize, styleColorSpace, destRect, srcRect, compositeOp, orientation); 213 213 214 214 if (imageObserver())
Note: See TracChangeset
for help on using the changeset viewer.