Bug 88579 - The size of RenderLayer is too damn high!
Summary: The size of RenderLayer is too damn high!
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-07 14:43 PDT by Julien Chaffraix
Modified: 2017-07-18 08:29 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Chaffraix 2012-06-07 14:43:39 PDT
While looking at some bad padding on RenderLayer, this is the size of RenderLayer:

struct SameSizeAsRenderLayer : public ScrollableArea {
    virtual ~SameSizeAsRenderLayer() { } // Allocate vtable pointer.
    void* m_pointers[17];
#if USE(ACCELERATED_COMPOSITING)
    void* m_backing;
#endif

    LayoutRect m_rects[3];
    LayoutSize m_layoutSizes[2];
    LayoutPoint m_layoutPoint;
    IntPoint m_point;
    LayoutUnit m_units[2];
    IntSize m_sizes[2];

    // We don't include our bitfield here to ensure that they are folded into the ones from ScrollableArea.
    // However it seems like some platforms don't fold the bitfield so you need another unsigned (as we have
    // 35 bits at the moment in RenderLayer - including the one from ScrollableArea).
};

COMPILE_ASSERT(sizeof(RenderLayer) == sizeof(SameSizeAsRenderLayer), RenderLayer_should_avoid_increasing);