Diff
Modified: trunk/Source/WebCore/ChangeLog (280360 => 280361)
--- trunk/Source/WebCore/ChangeLog 2021-07-27 23:45:49 UTC (rev 280360)
+++ trunk/Source/WebCore/ChangeLog 2021-07-27 23:48:49 UTC (rev 280361)
@@ -1,5 +1,35 @@
2021-07-27 Myles C. Maxfield <[email protected]>
+ [GPU Process] Code cleanup after r280356
+ https://bugs.webkit.org/show_bug.cgi?id=228495
+
+ Reviewed by Wenson Hsieh.
+
+ 3 things:
+ 1. Rename cacheNativeImage()/cacheFont() to recordNativeImageUse()/recordFontUse() since it does more
+ than caching now
+ 2. Mark overridden functions as final in RemoteImageBufferProxy because no class inherits from it
+ 3. Remove unnecessary WebCore:: where it isn't necessary
+
+ No new tests because there is no behavior change.
+
+ * platform/graphics/displaylists/DisplayListRecorder.cpp:
+ (WebCore::DisplayList::Recorder::putPixelBuffer):
+ (WebCore::DisplayList::Recorder::recordNativeImageUse):
+ (WebCore::DisplayList::Recorder::appendStateChangeItem):
+ (WebCore::DisplayList::Recorder::appendDrawGlyphsItemWithCachedFont):
+ (WebCore::DisplayList::Recorder::drawImageBuffer):
+ (WebCore::DisplayList::Recorder::drawNativeImage):
+ (WebCore::DisplayList::Recorder::drawPattern):
+ (WebCore::DisplayList::Recorder::cacheNativeImage): Deleted.
+ * platform/graphics/displaylists/DisplayListRecorder.h:
+ (WebCore::DisplayList::Recorder::Delegate::recordNativeImageUse):
+ (WebCore::DisplayList::Recorder::Delegate::recordFontUse):
+ (WebCore::DisplayList::Recorder::Delegate::cacheNativeImage): Deleted.
+ (WebCore::DisplayList::Recorder::Delegate::cacheFont): Deleted.
+
+2021-07-27 Myles C. Maxfield <[email protected]>
+
[GPU Process] Start tracking resource uses for NativeImages and Fonts
https://bugs.webkit.org/show_bug.cgi?id=228224
Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp (280360 => 280361)
--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp 2021-07-27 23:45:49 UTC (rev 280360)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp 2021-07-27 23:48:49 UTC (rev 280361)
@@ -71,7 +71,7 @@
append<GetPixelBuffer>(outputFormat, sourceRect);
}
-void Recorder::putPixelBuffer(const WebCore::PixelBuffer& pixelBuffer, const WebCore::IntRect& srcRect, const WebCore::IntPoint& destPoint, WebCore::AlphaPremultiplication destFormat)
+void Recorder::putPixelBuffer(const PixelBuffer& pixelBuffer, const IntRect& srcRect, const IntPoint& destPoint, AlphaPremultiplication destFormat)
{
append<PutPixelBuffer>(pixelBuffer, srcRect, destPoint, destFormat);
}
@@ -101,10 +101,10 @@
return true;
}
-void Recorder::cacheNativeImage(NativeImage& image)
+void Recorder::recordNativeImageUse(NativeImage& image)
{
if (m_delegate)
- m_delegate->cacheNativeImage(image);
+ m_delegate->recordNativeImageUse(image);
m_displayList.cacheNativeImage(image);
}
@@ -112,9 +112,9 @@
{
if (!containsOnlyInlineStateChanges(changes, changeFlags)) {
if (auto pattern = changes.m_state.strokePattern)
- cacheNativeImage(pattern->tileImage());
+ recordNativeImageUse(pattern->tileImage());
if (auto pattern = changes.m_state.fillPattern)
- cacheNativeImage(pattern->tileImage());
+ recordNativeImageUse(pattern->tileImage());
append<SetState>(changes.m_state, changeFlags);
return;
}
@@ -193,12 +193,12 @@
void Recorder::appendDrawGlyphsItemWithCachedFont(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned count, const FloatPoint& localAnchor, FontSmoothingMode smoothingMode)
{
if (m_delegate)
- m_delegate->cacheFont(const_cast<Font&>(font));
+ m_delegate->recordFontUse(const_cast<Font&>(font));
m_displayList.cacheFont(const_cast<Font&>(font));
append<DrawGlyphs>(font, glyphs, advances, count, localAnchor, smoothingMode);
}
-void Recorder::drawImageBuffer(WebCore::ImageBuffer& imageBuffer, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions& options)
+void Recorder::drawImageBuffer(ImageBuffer& imageBuffer, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions& options)
{
if (!canDrawImageBuffer(imageBuffer)) {
GraphicsContext::drawImageBuffer(imageBuffer, destRect, srcRect, options);
@@ -210,13 +210,13 @@
void Recorder::drawNativeImage(NativeImage& image, const FloatSize& imageSize, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions& options)
{
- cacheNativeImage(image);
+ recordNativeImageUse(image);
append<DrawNativeImage>(image.renderingResourceIdentifier(), imageSize, destRect, srcRect, options);
}
void Recorder::drawPattern(NativeImage& image, const FloatSize& imageSize, const FloatRect& destRect, const FloatRect& tileRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, const ImagePaintingOptions& options)
{
- cacheNativeImage(image);
+ recordNativeImageUse(image);
append<DrawPattern>(image.renderingResourceIdentifier(), imageSize, destRect, tileRect, patternTransform, phase, spacing, options);
}
Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h (280360 => 280361)
--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h 2021-07-27 23:45:49 UTC (rev 280360)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h 2021-07-27 23:48:49 UTC (rev 280361)
@@ -67,9 +67,9 @@
public:
virtual ~Delegate() { }
virtual bool canAppendItemOfType(ItemType) { return false; }
- virtual void cacheNativeImage(NativeImage&) { }
+ virtual void recordNativeImageUse(NativeImage&) { }
virtual bool isCachedImageBuffer(const ImageBuffer&) const { return false; }
- virtual void cacheFont(Font&) { }
+ virtual void recordFontUse(Font&) { }
virtual RenderingMode renderingMode() const { return RenderingMode::Unaccelerated; }
};
@@ -202,7 +202,7 @@
template<typename T>
static constexpr bool itemNeedsState();
- void cacheNativeImage(NativeImage&);
+ void recordNativeImageUse(NativeImage&);
void appendStateChangeItemIfNecessary();
void appendStateChangeItem(const GraphicsContextStateChange&, GraphicsContextState::StateChangeFlags);
Modified: trunk/Source/WebKit/ChangeLog (280360 => 280361)
--- trunk/Source/WebKit/ChangeLog 2021-07-27 23:45:49 UTC (rev 280360)
+++ trunk/Source/WebKit/ChangeLog 2021-07-27 23:48:49 UTC (rev 280361)
@@ -1,3 +1,19 @@
+2021-07-27 Myles C. Maxfield <[email protected]>
+
+ [GPU Process] Code cleanup after r280356
+ https://bugs.webkit.org/show_bug.cgi?id=228495
+
+ Reviewed by Wenson Hsieh.
+
+ * WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
+ (WebKit::RemoteImageBufferProxy::putPixelBuffer):
+ * WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp:
+ (WebKit::RemoteResourceCacheProxy::recordNativeImageUse):
+ (WebKit::RemoteResourceCacheProxy::recordFontUse):
+ (WebKit::RemoteResourceCacheProxy::cacheNativeImage): Deleted.
+ (WebKit::RemoteResourceCacheProxy::cacheFont): Deleted.
+ * WebProcess/GPU/graphics/RemoteResourceCacheProxy.h:
+
2021-07-27 Aditya Keerthi <[email protected]>
[iOS] REGRESSION: Tapping a <select> element does not show a menu on many websites
Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h (280360 => 280361)
--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h 2021-07-27 23:45:49 UTC (rev 280360)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h 2021-07-27 23:48:49 UTC (rev 280361)
@@ -110,7 +110,7 @@
m_drawingContext.displayList().setTracksDrawingItemExtents(false);
}
- WebCore::RenderingMode renderingMode() const override { return BaseDisplayListImageBuffer::renderingMode(); }
+ WebCore::RenderingMode renderingMode() const final { return BaseDisplayListImageBuffer::renderingMode(); }
// It is safe to access m_receivedFlushIdentifier from the main thread without locking since it
// only gets modified on the main thread.
@@ -120,7 +120,7 @@
return m_sentFlushIdentifier != m_receivedFlushIdentifier;
}
- void didFlush(WebCore::DisplayList::FlushIdentifier flushIdentifier) override
+ void didFlush(WebCore::DisplayList::FlushIdentifier flushIdentifier) final
{
ASSERT(isMainRunLoop());
Locker locker { m_receivedFlushIdentifierLock };
@@ -150,7 +150,7 @@
RELEASE_LOG_FAULT(SharedDisplayLists, "Exceeded timeout while waiting for flush in remote rendering backend: %" PRIu64 ".", m_remoteRenderingBackendProxy->renderingBackendIdentifier().toUInt64());
}
- WebCore::ImageBufferBackend* ensureBackendCreated() const override
+ WebCore::ImageBufferBackend* ensureBackendCreated() const final
{
if (!m_remoteRenderingBackendProxy)
return m_backend.get();
@@ -164,7 +164,7 @@
return m_backend.get();
}
- String toDataURL(const String& mimeType, std::optional<double> quality, WebCore::PreserveResolution preserveResolution) const override
+ String toDataURL(const String& mimeType, std::optional<double> quality, WebCore::PreserveResolution preserveResolution) const final
{
if (UNLIKELY(!m_remoteRenderingBackendProxy))
return { };
@@ -173,7 +173,7 @@
return m_remoteRenderingBackendProxy->getDataURLForImageBuffer(mimeType, quality, preserveResolution, m_renderingResourceIdentifier);
}
- Vector<uint8_t> toData(const String& mimeType, std::optional<double> quality = std::nullopt) const override
+ Vector<uint8_t> toData(const String& mimeType, std::optional<double> quality = std::nullopt) const final
{
if (UNLIKELY(!m_remoteRenderingBackendProxy))
return { };
@@ -182,7 +182,7 @@
return m_remoteRenderingBackendProxy->getDataForImageBuffer(mimeType, quality, m_renderingResourceIdentifier);
}
- RefPtr<WebCore::NativeImage> copyNativeImage(WebCore::BackingStoreCopy = WebCore::BackingStoreCopy::CopyBackingStore) const override
+ RefPtr<WebCore::NativeImage> copyNativeImage(WebCore::BackingStoreCopy = WebCore::BackingStoreCopy::CopyBackingStore) const final
{
if (UNLIKELY(!m_remoteRenderingBackendProxy))
return { };
@@ -193,7 +193,7 @@
return WebCore::NativeImage::create(bitmap->createPlatformImage());
}
- RefPtr<WebCore::Image> copyImage(WebCore::BackingStoreCopy = WebCore::BackingStoreCopy::CopyBackingStore, WebCore::PreserveResolution preserveResolution = WebCore::PreserveResolution::No) const override
+ RefPtr<WebCore::Image> copyImage(WebCore::BackingStoreCopy = WebCore::BackingStoreCopy::CopyBackingStore, WebCore::PreserveResolution preserveResolution = WebCore::PreserveResolution::No) const final
{
if (UNLIKELY(!m_remoteRenderingBackendProxy))
return { };
@@ -204,7 +204,7 @@
return bitmap->createImage();
}
- std::optional<WebCore::PixelBuffer> getPixelBuffer(const WebCore::PixelBufferFormat& destinationFormat, const WebCore::IntRect& srcRect) const override
+ std::optional<WebCore::PixelBuffer> getPixelBuffer(const WebCore::PixelBufferFormat& destinationFormat, const WebCore::IntRect& srcRect) const final
{
if (UNLIKELY(!m_remoteRenderingBackendProxy))
return std::nullopt;
@@ -230,7 +230,7 @@
return pixelBuffer;
}
- void putPixelBuffer(const WebCore::PixelBuffer& pixelBuffer, const WebCore::IntRect& srcRect, const WebCore::IntPoint& destPoint = { }, WebCore::AlphaPremultiplication destFormat = WebCore::AlphaPremultiplication::Premultiplied) override
+ void putPixelBuffer(const WebCore::PixelBuffer& pixelBuffer, const WebCore::IntRect& srcRect, const WebCore::IntPoint& destPoint = { }, WebCore::AlphaPremultiplication destFormat = WebCore::AlphaPremultiplication::Premultiplied) final
{
// The math inside PixelBuffer::create() doesn't agree with the math inside ImageBufferBackend::putPixelBuffer() about how m_resolutionScale interacts with the data in the ImageBuffer.
// This means that putPixelBuffer() is only called when resolutionScale() == 1.
@@ -238,15 +238,15 @@
m_drawingContext.recorder().putPixelBuffer(pixelBuffer, srcRect, destPoint, destFormat);
}
- bool prefersPreparationForDisplay() override { return true; }
+ bool prefersPreparationForDisplay() final { return true; }
- void flushContext() override
+ void flushContext() final
{
flushDrawingContext();
m_backend->flushContext();
}
- void flushDrawingContext() override
+ void flushDrawingContext() final
{
if (UNLIKELY(!m_remoteRenderingBackendProxy))
return;
@@ -256,7 +256,7 @@
waitForDidFlushWithTimeout();
}
- void flushDrawingContextAsync() override
+ void flushDrawingContextAsync() final
{
if (UNLIKELY(!m_remoteRenderingBackendProxy))
return;
@@ -270,13 +270,13 @@
clearDisplayList();
}
- void cacheNativeImage(WebCore::NativeImage& image) override
+ void recordNativeImageUse(WebCore::NativeImage& image) final
{
if (m_remoteRenderingBackendProxy)
- m_remoteRenderingBackendProxy->remoteResourceCacheProxy().cacheNativeImage(image);
+ m_remoteRenderingBackendProxy->remoteResourceCacheProxy().recordNativeImageUse(image);
}
- bool isCachedImageBuffer(const WebCore::ImageBuffer& imageBuffer) const override
+ bool isCachedImageBuffer(const WebCore::ImageBuffer& imageBuffer) const final
{
if (!m_remoteRenderingBackendProxy)
return false;
@@ -303,7 +303,7 @@
m_drawingContext.displayList().clear();
}
- bool canAppendItemOfType(WebCore::DisplayList::ItemType) override
+ bool canAppendItemOfType(WebCore::DisplayList::ItemType) final
{
if (UNLIKELY(!m_remoteRenderingBackendProxy))
return false;
@@ -311,16 +311,16 @@
return true;
}
- void didAppendData(const WebCore::DisplayList::ItemBufferHandle& handle, size_t numberOfBytes, WebCore::DisplayList::DidChangeItemBuffer didChangeItemBuffer) override
+ void didAppendData(const WebCore::DisplayList::ItemBufferHandle& handle, size_t numberOfBytes, WebCore::DisplayList::DidChangeItemBuffer didChangeItemBuffer) final
{
if (LIKELY(m_remoteRenderingBackendProxy))
m_remoteRenderingBackendProxy->didAppendData(handle, numberOfBytes, didChangeItemBuffer, m_renderingResourceIdentifier);
}
- void cacheFont(WebCore::Font& font) override
+ void recordFontUse(WebCore::Font& font) final
{
if (m_remoteRenderingBackendProxy)
- m_remoteRenderingBackendProxy->remoteResourceCacheProxy().cacheFont(font);
+ m_remoteRenderingBackendProxy->remoteResourceCacheProxy().recordFontUse(font);
}
WebCore::DisplayList::ItemBufferHandle createItemBuffer(size_t capacity) final
@@ -343,7 +343,7 @@
}, item);
}
- std::unique_ptr<WebCore::ThreadSafeImageBufferFlusher> createFlusher() override
+ std::unique_ptr<WebCore::ThreadSafeImageBufferFlusher> createFlusher() final
{
return WTF::makeUnique<ThreadSafeRemoteImageBufferFlusher<BackendType>>(*this);
}
Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp (280360 => 280361)
--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp 2021-07-27 23:45:49 UTC (rev 280360)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp 2021-07-27 23:48:49 UTC (rev 280361)
@@ -78,7 +78,7 @@
return bitmap;
}
-void RemoteResourceCacheProxy::cacheNativeImage(NativeImage& image)
+void RemoteResourceCacheProxy::recordNativeImageUse(NativeImage& image)
{
auto iterator = m_nativeImages.find(image.renderingResourceIdentifier());
if (iterator != m_nativeImages.end()) {
@@ -105,7 +105,7 @@
m_remoteRenderingBackendProxy.cacheNativeImage(handle, image.renderingResourceIdentifier());
}
-void RemoteResourceCacheProxy::cacheFont(Font& font)
+void RemoteResourceCacheProxy::recordFontUse(Font& font)
{
auto result = m_fonts.ensure(font.renderingResourceIdentifier(), [&] {
return FontState { m_remoteRenderingBackendProxy.renderingUpdateID(), 1 };
Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h (280360 => 280361)
--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h 2021-07-27 23:45:49 UTC (rev 280360)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h 2021-07-27 23:48:49 UTC (rev 280361)
@@ -50,8 +50,8 @@
WebCore::ImageBuffer* cachedImageBuffer(WebCore::RenderingResourceIdentifier);
void releaseImageBuffer(WebCore::RenderingResourceIdentifier);
- void cacheNativeImage(WebCore::NativeImage&);
- void cacheFont(WebCore::Font&);
+ void recordNativeImageUse(WebCore::NativeImage&);
+ void recordFontUse(WebCore::Font&);
void finalizeRenderingUpdate();