Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Issue 112633004: Use a bitmask for SVG render object types (Closed)

Created:
7 years ago by pdr.
Modified:
7 years ago
CC:
blink-reviews, krit, bemjb+rendering_chromium.org, zoltan1, eae+blinkwatch, leviw+renderwatch, f(malita), jchaffraix+rendering, pdr, Stephen Chennney, rwlbuis
Visibility:
Public.

Description

Use a bitmask for SVG render object types This patch changes the virtual isSVG*() functions into regular functions that check a bitmask (via the new virtual "getSVGType"). This should have no impact on performance. For reference, a similar pattern is used in Node.h. This change adds RenderObject::isSVG() with no new virtual calls. In a future patch, this new function will let us to remove the O(height of tree) setNeedsBoundariesUpdate call in RenderObject::willBeRemovedFromTree :) Additionally, this change opens the door for some useful cleanups. For example, RenderSVGResource has RenderSVGResourceMask which can be folded into RenderObject::SVGType. Similarly, there is no isRenderSVGModelObject() function today but this will be trivial to add after this patch. For reference, I put together a diagram of the SVG render tree hierarchy: https://docs.google.com/a/chromium.org/drawings/d/1nayJX5XcclYj_-blbVuakVNjVWdRAzC5i5s6xBeHfzA/edit

Patch Set 1 #

Patch Set 2 : Minor cleanups #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -38 lines) Patch
M Source/core/rendering/RenderObject.h View 1 2 chunks +44 lines, -19 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGContainer.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGForeignObject.h View 2 chunks +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGGradientStop.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGHiddenContainer.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGImage.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGInline.h View 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGInlineText.h View 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGPath.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceContainer.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceFilter.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGRoot.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGShape.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGText.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGTextPath.h View 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGTransformableContainer.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGViewportContainer.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
pdr.
This is a bit experimental and a lot of work for just isSVG(). What do ...
7 years ago (2013-12-16 06:51:21 UTC) #1
pdr.
On 2013/12/16 06:51:21, pdr wrote: > This is a bit experimental and a lot of ...
7 years ago (2013-12-17 00:43:47 UTC) #2
pdr.
7 years ago (2013-12-17 05:12:49 UTC) #3
On 2013/12/17 00:43:47, pdr wrote:
> On 2013/12/16 06:51:21, pdr wrote:
> > This is a bit experimental and a lot of work for just isSVG(). What do you
> > think?
> 
> Ojan has convinced me we should go the route of adding virtual bool isSVG()
> instead.
> 
> This complexity is fragile and, if we need it in the future, we can rip out
the
> virtuals and land this patch.

Closing this issue. New and improved approach:
https://codereview.chromium.org/108203005/

Powered by Google App Engine
This is Rietveld 408576698