Changeset 285090 in webkit
- Timestamp:
- Oct 30, 2021, 8:22:46 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r285089 r285090 1 2021-10-30 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Migrate the first few callers from ImageBuffer::truncatedLogicalSize() to ImageBuffer::logicalSize() 4 https://bugs.webkit.org/show_bug.cgi?id=232528 5 6 Reviewed by Tim Horton. 7 8 These are the callers which seem obviously correct to migrate from truncatedLogicalSize() to logicalSize(), 9 because these are the callers that immediately cast the result to FloatSize. That means, before this patch, 10 these callers are going from float -> int -> float. 11 12 This patch is the fourth step in https://bugs.webkit.org/show_bug.cgi?id=225377. There is no situation where 13 truncating the logical size is meaningful - we either want the float logical size, or we want the physical 14 number of texels in the image (which is the logical size, times the resolution, rounded up to an int size). 15 Eventually, we should move all callers off of truncatedLogicalSize() and on to either logicalSize() or 16 a yet-to-be-written physicalSize()/texelCount()/bikeshedName(). 17 18 * platform/graphics/GraphicsContext.cpp: 19 (WebCore::GraphicsContext::drawImageBuffer): 20 (WebCore::GraphicsContext::drawConsumingImageBuffer): 21 * platform/graphics/displaylists/DisplayListImageBuffer.h: 22 (WebCore::DisplayList::ImageBuffer::ImageBuffer): 23 * platform/graphics/filters/FEBlend.cpp: 24 (WebCore::FEBlend::platformApplySoftware): 25 * platform/graphics/filters/FEComposite.cpp: 26 (WebCore::FEComposite::platformApplySoftware): 27 * rendering/CSSFilter.cpp: 28 (WebCore::CSSFilter::allocateBackingStoreIfNeeded): 29 * rendering/svg/RenderSVGResourcePattern.cpp: 30 (WebCore::RenderSVGResourcePattern::buildPattern): 31 1 32 2021-10-30 Wenson Hsieh <wenson_hsieh@apple.com> 2 33 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r285071 r285090 592 592 void GraphicsContext::drawImageBuffer(ImageBuffer& image, const FloatPoint& destination, const ImagePaintingOptions& imagePaintingOptions) 593 593 { 594 drawImageBuffer(image, FloatRect(destination, image. truncatedLogicalSize()), FloatRect(FloatPoint(), image.truncatedLogicalSize()), imagePaintingOptions);594 drawImageBuffer(image, FloatRect(destination, image.logicalSize()), FloatRect({ }, image.logicalSize()), imagePaintingOptions); 595 595 } 596 596 597 597 void GraphicsContext::drawImageBuffer(ImageBuffer& image, const FloatRect& destination, const ImagePaintingOptions& imagePaintingOptions) 598 598 { 599 drawImageBuffer(image, destination, FloatRect( FloatPoint(), FloatSize(image.truncatedLogicalSize())), imagePaintingOptions);599 drawImageBuffer(image, destination, FloatRect({ }, image.logicalSize()), imagePaintingOptions); 600 600 } 601 601 … … 610 610 if (!image) 611 611 return; 612 IntSize imageLogicalSize = image->truncatedLogicalSize();613 drawConsumingImageBuffer(WTFMove(image), FloatRect(destination, imageLogicalSize), FloatRect( FloatPoint(), imageLogicalSize), imagePaintingOptions);612 auto imageLogicalSize = image->logicalSize(); 613 drawConsumingImageBuffer(WTFMove(image), FloatRect(destination, imageLogicalSize), FloatRect({ }, imageLogicalSize), imagePaintingOptions); 614 614 } 615 615 … … 618 618 if (!image) 619 619 return; 620 IntSize imageLogicalSize = image->truncatedLogicalSize();621 drawConsumingImageBuffer(WTFMove(image), destination, FloatRect( FloatPoint(), FloatSize(imageLogicalSize)), imagePaintingOptions);620 auto imageLogicalSize = image->logicalSize(); 621 drawConsumingImageBuffer(WTFMove(image), destination, FloatRect({ }, imageLogicalSize), imagePaintingOptions); 622 622 } 623 623 -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListImageBuffer.h
r285071 r285090 53 53 ImageBuffer(const ImageBufferBackend::Parameters& parameters, std::unique_ptr<BackendType>&& backend) 54 54 : BaseConcreteImageBuffer(parameters, WTFMove(backend)) 55 , m_drawingContext( truncatedLogicalSize(), baseTransform())55 , m_drawingContext(logicalSize(), baseTransform()) 56 56 , m_writingClient(makeUnique<InMemoryDisplayList::WritingClient>()) 57 57 , m_readingClient(makeUnique<InMemoryDisplayList::ReadingClient>()) … … 63 63 ImageBuffer(const ImageBufferBackend::Parameters& parameters, RecorderImpl::Delegate* delegate = nullptr) 64 64 : BaseConcreteImageBuffer(parameters) 65 , m_drawingContext( truncatedLogicalSize(), baseTransform(), delegate)65 , m_drawingContext(logicalSize(), baseTransform(), delegate) 66 66 , m_writingClient(makeUnique<InMemoryDisplayList::WritingClient>()) 67 67 , m_readingClient(makeUnique<InMemoryDisplayList::ReadingClient>()) -
trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp
r285071 r285090 71 71 72 72 filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect())); 73 filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->truncatedLogicalSize()), { CompositeOperator::SourceOver, m_mode });73 filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), { { }, imageBuffer->logicalSize() }, { CompositeOperator::SourceOver, m_mode }); 74 74 } 75 75 #endif -
trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp
r285071 r285090 279 279 case FECOMPOSITE_OPERATOR_OUT: 280 280 filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect())); 281 filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()), IntRect(IntPoint(), imageBuffer2->truncatedLogicalSize()), CompositeOperator::DestinationOut);281 filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()), { { }, imageBuffer2->logicalSize() }, CompositeOperator::DestinationOut); 282 282 break; 283 283 case FECOMPOSITE_OPERATOR_ATOP: 284 284 filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect())); 285 filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->truncatedLogicalSize()), CompositeOperator::SourceAtop);285 filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), { { }, imageBuffer->logicalSize() }, CompositeOperator::SourceAtop); 286 286 break; 287 287 case FECOMPOSITE_OPERATOR_XOR: 288 288 filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect())); 289 filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->truncatedLogicalSize()), CompositeOperator::XOR);289 filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), { { }, imageBuffer->logicalSize() }, CompositeOperator::XOR); 290 290 break; 291 291 case FECOMPOSITE_OPERATOR_LIGHTER: 292 292 filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect())); 293 filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->truncatedLogicalSize()), CompositeOperator::PlusLighter);293 filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), { { }, imageBuffer->logicalSize() }, CompositeOperator::PlusLighter); 294 294 break; 295 295 default: -
trunk/Source/WebCore/rendering/CSSFilter.cpp
r285071 r285090 332 332 return; 333 333 334 IntSize logicalSize { m_sourceDrawingRegion.size() };335 if (!sourceImage() || sourceImage()-> truncatedLogicalSize() != logicalSize) {334 auto logicalSize = m_sourceDrawingRegion.size(); 335 if (!sourceImage() || sourceImage()->logicalSize() != logicalSize) { 336 336 #if USE(DIRECT2D) 337 337 setSourceImage(ImageBuffer::create(logicalSize, renderingMode(), &targetContext, filterScale(), DestinationColorSpace::SRGB(), PixelFormat::BGRA8)); -
trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
r285071 r285090 112 112 return nullptr; 113 113 114 const IntSize tileImageSize = tileImage->truncatedLogicalSize();114 auto tileImageSize = tileImage->logicalSize(); 115 115 116 116 auto copiedImage = ImageBuffer::sinkIntoNativeImage(WTFMove(tileImage)); -
trunk/Source/WebKit/ChangeLog
r285089 r285090 1 2021-10-30 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Migrate the first few callers from ImageBuffer::truncatedLogicalSize() to ImageBuffer::logicalSize() 4 https://bugs.webkit.org/show_bug.cgi?id=232528 5 6 Reviewed by Tim Horton. 7 8 * WebProcess/GPU/graphics/RemoteImageBufferProxy.h: 9 (WebKit::RemoteImageBufferProxy::RemoteImageBufferProxy): 10 1 11 2021-10-30 Wenson Hsieh <wenson_hsieh@apple.com> 2 12 -
trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h
r285088 r285090 103 103 : BaseConcreteImageBuffer(parameters) 104 104 , m_remoteRenderingBackendProxy(remoteRenderingBackendProxy) 105 , m_remoteDisplayList(*this, remoteRenderingBackendProxy, { { }, BaseConcreteImageBuffer:: truncatedLogicalSize() }, BaseConcreteImageBuffer::baseTransform())105 , m_remoteDisplayList(*this, remoteRenderingBackendProxy, { { }, BaseConcreteImageBuffer::logicalSize() }, BaseConcreteImageBuffer::baseTransform()) 106 106 { 107 107 ASSERT(m_remoteRenderingBackendProxy);
Note:
See TracChangeset
for help on using the changeset viewer.