Changeset 142123 in webkit
- Timestamp:
- Feb 7, 2013 7:53:50 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r142122 r142123 1 2013-02-07 Stephen Chenney <schenney@chromium.org> 2 3 GraphicsContext::drawImageBuffer is inefficient 4 https://bugs.webkit.org/show_bug.cgi?id=104367 5 6 Reviewed by Dirk Schulze. 7 8 This patch converts all of the drawImage and drawImageBuffer 9 convenience methods (those that take parameters of various types) to 10 invoke the implementing method (that takes FloatRect src and dest) 11 directly, rather than through the next-most-convenient method as was 12 done previously. This will knock some layers off the stack compared 13 to the existing code, and may remove one or two constructor invocations. 14 This may be slightly more efficient, and also makes debugging simpler. 15 16 Also removes the unused drawImage method that takes and IntRect source 17 area and IntRect destination. It is not invoked anywhere in a standard 18 WebKit checkout. 19 20 No new tests. No change in functionality, just refactoring. 21 22 * platform/graphics/GraphicsContext.cpp: 23 (WebCore::GraphicsContext::drawImage): Modify all the convenience versions to call 24 the implementing version directly. 25 (WebCore::GraphicsContext::drawImageBuffer): Modify all the convenience versions 26 to call the implementing version directly. 27 * platform/graphics/GraphicsContext.h: 28 (GraphicsContext): Remove IntRect, IntRect version of drawImage. 29 1 30 2013-02-07 Kent Tamura <tkent@chromium.org> 2 31 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r140279 r142123 451 451 if (!image) 452 452 return; 453 drawImage(image, styleColorSpace, p, IntRect(IntPoint(), image->size()), op, shouldRespectImageOrientation);453 drawImage(image, styleColorSpace, FloatRect(IntRect(p, image->size())), FloatRect(FloatPoint(), FloatSize(image->size())), op, shouldRespectImageOrientation); 454 454 } 455 455 … … 458 458 if (!image) 459 459 return; 460 drawImage(image, styleColorSpace, r, IntRect(IntPoint(), image->size()), op, shouldRespectImageOrientation, useLowQualityScale);460 drawImage(image, styleColorSpace, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size())), op, shouldRespectImageOrientation, useLowQualityScale); 461 461 } 462 462 463 463 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation) 464 464 { 465 drawImage(image, styleColorSpace, IntRect(dest, srcRect.size()), srcRect, op, shouldRespectImageOrientation); 466 } 467 468 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntRect& dest, const IntRect& srcRect, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale) 469 { 470 drawImage(image, styleColorSpace, FloatRect(dest), srcRect, op, shouldRespectImageOrientation, useLowQualityScale); 465 drawImage(image, styleColorSpace, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, shouldRespectImageOrientation); 471 466 } 472 467 473 468 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale) 474 469 { 475 drawImage(image, styleColorSpace, FloatRect(dest), src, op, BlendModeNormal, shouldRespectImageOrientation, useLowQualityScale);470 drawImage(image, styleColorSpace, dest, src, op, BlendModeNormal, shouldRespectImageOrientation, useLowQualityScale); 476 471 } 477 472 … … 544 539 if (!image) 545 540 return; 546 drawImageBuffer(image, styleColorSpace, p, IntRect(IntPoint(), image->logicalSize()), op, blendMode);541 drawImageBuffer(image, styleColorSpace, FloatRect(IntRect(p, image->logicalSize())), FloatRect(FloatPoint(), FloatSize(image->logicalSize())), op, blendMode); 547 542 } 548 543 … … 551 546 if (!image) 552 547 return; 553 drawImageBuffer(image, styleColorSpace, r, IntRect(IntPoint(), image->logicalSize()), op, blendMode, useLowQualityScale);548 drawImageBuffer(image, styleColorSpace, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->logicalSize())), op, blendMode, useLowQualityScale); 554 549 } 555 550 556 551 void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, BlendMode blendMode) 557 552 { 558 drawImageBuffer(image, styleColorSpace, IntRect(dest, srcRect.size()), srcRect, op, blendMode);553 drawImageBuffer(image, styleColorSpace, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, blendMode); 559 554 } 560 555 561 556 void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntRect& dest, const IntRect& srcRect, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale) 562 557 { 563 drawImageBuffer(image, styleColorSpace, FloatRect(dest), srcRect, op, blendMode, useLowQualityScale);558 drawImageBuffer(image, styleColorSpace, FloatRect(dest), FloatRect(srcRect), op, blendMode, useLowQualityScale); 564 559 } 565 560 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r139967 r142123 322 322 void drawImage(Image*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false); 323 323 void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation); 324 void drawImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);325 324 void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect); 326 325 void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
Note: See TracChangeset
for help on using the changeset viewer.