Consolidate DisplayList::ResourceHeap
<rdar://problem/84013167>
Created attachment 440573 [details] Patch
Created attachment 440574 [details] Patch
Comment on attachment 440574 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440574&action=review > Source/WebCore/platform/graphics/displaylists/DisplayListResourceHeap.h:44 > + using ImageBufferHashMap = HashMap<RenderingResourceIdentifier, Ref<ImageBuffer>>; > + using NativeImageHashMap = HashMap<RenderingResourceIdentifier, Ref<NativeImage>>; > + using FontRenderingResourceMap = HashMap<RenderingResourceIdentifier, Ref<Font>>; > + > + ResourceHeap() = default; These are unnecessary.
Created attachment 440575 [details] Patch
Created attachment 440639 [details] Patch
Comment on attachment 440639 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440639&action=review > Source/WebCore/platform/graphics/displaylists/DisplayListResourceHeap.h:115 > + HashMap<RenderingResourceIdentifier, Ref<ImageBuffer>> m_imageBuffers; > + HashMap<RenderingResourceIdentifier, Ref<NativeImage>> m_nativeImages; > + HashMap<RenderingResourceIdentifier, Ref<Font>> m_fonts; Did you consider HashMap<RenderingResourceIdentifier, Variant<....>> ? An identifier will never be shared between these types, right?
Comment on attachment 440639 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440639&action=review >> Source/WebCore/platform/graphics/displaylists/DisplayListResourceHeap.h:115 >> + HashMap<RenderingResourceIdentifier, Ref<Font>> m_fonts; > > Did you consider HashMap<RenderingResourceIdentifier, Variant<....>> ? An identifier will never be shared between these types, right? ``` static_assert failed: For conversion construction of variants, exactly one type must be constructible ``` 😭
Comment on attachment 440639 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440639&action=review >>> Source/WebCore/platform/graphics/displaylists/DisplayListResourceHeap.h:115 >>> + HashMap<RenderingResourceIdentifier, Ref<Font>> m_fonts; >> >> Did you consider HashMap<RenderingResourceIdentifier, Variant<....>> ? An identifier will never be shared between these types, right? > > ``` > static_assert failed: For conversion construction of variants, exactly one type must be constructible > ``` > > 😭 Whoops, ignore that, I got it to work.
Created attachment 440892 [details] Patch for committing
Created attachment 440897 [details] Patch for committing
Committed r283971 (242818@main): <https://commits.webkit.org/242818@main>