Commit 2f6e3002 authored by fs@opera.com's avatar fs@opera.com

Un-inline requestPaintingResource in RenderSVGResource.cpp

This method is large, and the gain that propagating the constant mode from
its caller is relatively small. Make {fill,stroke}PaintingResource default
inline instead, and un-inline requestPaintingResource and move it into the
class.

Review URL: https://codereview.chromium.org/563973003

git-svn-id: svn://svn.chromium.org/blink/trunk@181906 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 60a3e5a8
......@@ -47,7 +47,7 @@ static inline bool inheritColorFromParentStyle(RenderObject* object, bool applyT
return true;
}
static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode mode, RenderObject* object, const RenderStyle* style, bool& hasFallback)
RenderSVGResource* RenderSVGResource::requestPaintingResource(RenderSVGResourceMode mode, RenderObject* object, const RenderStyle* style, bool& hasFallback)
{
ASSERT(object);
ASSERT(style);
......@@ -147,16 +147,6 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
return uriResource;
}
RenderSVGResource* RenderSVGResource::fillPaintingResource(RenderObject* object, const RenderStyle* style, bool& hasFallback)
{
return requestPaintingResource(ApplyToFillMode, object, style, hasFallback);
}
RenderSVGResource* RenderSVGResource::strokePaintingResource(RenderObject* object, const RenderStyle* style, bool& hasFallback)
{
return requestPaintingResource(ApplyToStrokeMode, object, style, hasFallback);
}
RenderSVGResourceSolidColor* RenderSVGResource::sharedSolidPaintingResource()
{
static RenderSVGResourceSolidColor* s_sharedSolidPaintingResource = 0;
......
......@@ -75,11 +75,20 @@ public:
// Helper utilities used in the render tree to access resources used for painting shapes/text (gradients & patterns & solid colors only)
// If hasFallback gets set to true, the sharedSolidPaintingResource is set to a fallback color.
static RenderSVGResource* fillPaintingResource(RenderObject*, const RenderStyle*, bool& hasFallback);
static RenderSVGResource* strokePaintingResource(RenderObject*, const RenderStyle*, bool& hasFallback);
static RenderSVGResource* fillPaintingResource(RenderObject* object, const RenderStyle* style, bool& hasFallback)
{
return requestPaintingResource(ApplyToFillMode, object, style, hasFallback);
}
static RenderSVGResource* strokePaintingResource(RenderObject* object, const RenderStyle* style, bool& hasFallback)
{
return requestPaintingResource(ApplyToStrokeMode, object, style, hasFallback);
}
static RenderSVGResourceSolidColor* sharedSolidPaintingResource();
static void markForLayoutAndParentResourceInvalidation(RenderObject*, bool needsLayout = true);
private:
static RenderSVGResource* requestPaintingResource(RenderSVGResourceMode, RenderObject*, const RenderStyle*, bool& hasFallback);
};
#define DEFINE_RENDER_SVG_RESOURCE_TYPE_CASTS(thisType, typeName) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment