RESOLVED FIXED 47751
[chromium] Avoid creating excessively large textures for composited layers
https://bugs.webkit.org/show_bug.cgi?id=47751
Summary [chromium] Avoid creating excessively large textures for composited layers
Vangelis Kokkevis
Reported 2010-10-15 16:30:20 PDT
Switch the compositor to "large layer" mode when a layer's size exceeds a reasonable value rather than the max texture size supported by the driver in order to avoid running low on vram on pages that create large layer (zooming in on maps.google.com creates several layers that can be 4Kx4K or bigger). This is a temporary solution until tiled layers are implemented.
Attachments
Proposed patch (11.65 KB, patch)
2010-10-15 17:25 PDT, Vangelis Kokkevis
jamesr: review+
Vangelis Kokkevis
Comment 1 2010-10-15 17:25:21 PDT
Created attachment 70927 [details] Proposed patch
James Robinson
Comment 2 2010-10-15 17:36:04 PDT
Comment on attachment 70927 [details] Proposed patch Will layers >2000 pixels wide still work at all? Monitors that support resolutions higher than that are still somewhat common
Vangelis Kokkevis
Comment 3 2010-10-15 17:57:42 PDT
(In reply to comment #2) > (From update of attachment 70927 [details]) > Will layers >2000 pixels wide still work at all? Monitors that support resolutions higher than that are still somewhat common They should work, as long as they are smaller than the max texture size supported by your driver. If you look at the ContentLayerChromium::requiresClippedUpdateRect() we switch to large layer mode when the layer exceeds the larger of 2000 or the browser window's visible area.
James Robinson
Comment 4 2010-10-18 14:28:20 PDT
Comment on attachment 70927 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=70927&action=review R=me > WebCore/platform/graphics/chromium/ContentLayerChromium.cpp:149 > + const int maxLayerSize = 2000; nit: should be static. it'll probably get inlined anyway
Adrienne Walker
Comment 5 2010-10-18 14:36:17 PDT
Comment on attachment 70927 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=70927&action=review > WebCore/platform/graphics/chromium/LayerRendererChromium.h:169 > IntRect m_rootVisibleRect; > IntRect m_rootContentRect; > + IntRect m_currentScissorRect; > Can we remove m_rootContentRect, then? I think the scissor rect replaces its purpose entirely.
Vangelis Kokkevis
Comment 6 2010-10-18 14:39:13 PDT
(In reply to comment #5) > (From update of attachment 70927 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=70927&action=review > > > WebCore/platform/graphics/chromium/LayerRendererChromium.h:169 > > IntRect m_rootVisibleRect; > > IntRect m_rootContentRect; > > + IntRect m_currentScissorRect; > > > > Can we remove m_rootContentRect, then? I think the scissor rect replaces its purpose entirely. m_currentScissorRect can actually change while drawing the composited layers (for example when we hit a layer that clips its descendants).
Vangelis Kokkevis
Comment 7 2010-10-18 14:43:00 PDT
(In reply to comment #4) > (From update of attachment 70927 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=70927&action=review > > R=me > > > WebCore/platform/graphics/chromium/ContentLayerChromium.cpp:149 > > + const int maxLayerSize = 2000; > > nit: should be static. it'll probably get inlined anyway Good point. I'll fix that before checking in.
Adrienne Walker
Comment 8 2010-10-18 14:57:56 PDT
> Can we remove m_rootContentRect, then? I think the scissor rect replaces its purpose entirely. Oops, my mistake. It's still getting used.
Vangelis Kokkevis
Comment 9 2010-10-18 16:54:11 PDT
Note You need to log in before you can comment on or make changes to this bug.