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

Unified Diff: Source/core/rendering/svg/SVGInlineTextBox.cpp

Issue 577583002: Drop RenderSVGResource::{fill,stroke}PaintingResource shims (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.cpp ('k') | Source/core/rendering/svg/SVGRenderTreeAsText.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGInlineTextBox.cpp
diff --git a/Source/core/rendering/svg/SVGInlineTextBox.cpp b/Source/core/rendering/svg/SVGInlineTextBox.cpp
index 8efc220aef7ff9f00f594bd39129efb3457d16e6..5b09a43c7dd9b144922ffa3ac822c1971be3eefc 100644
--- a/Source/core/rendering/svg/SVGInlineTextBox.cpp
+++ b/Source/core/rendering/svg/SVGInlineTextBox.cpp
@@ -363,34 +363,28 @@ private:
};
bool PaintingResourceScope::acquirePaintingResource(GraphicsContext*& context, float scalingFactor,
- RenderStyle* style, RenderSVGResourceModeFlags resourceMode)
+ RenderStyle* style, RenderSVGResourceModeFlags resourceModeFlags)
{
// Callers must save the context state before calling when scalingFactor is not 1.
ASSERT(scalingFactor);
ASSERT(style);
- ASSERT(resourceMode != ApplyToDefaultMode);
+ ASSERT(resourceModeFlags != ApplyToDefaultMode);
+ RenderSVGResourceMode resourceMode = static_cast<RenderSVGResourceMode>(resourceModeFlags & (ApplyToFillMode | ApplyToStrokeMode));
+ ASSERT(resourceMode == ApplyToFillMode || resourceMode == ApplyToStrokeMode);
bool hasFallback = false;
- if (resourceMode & ApplyToFillMode)
- m_paintingResource = RenderSVGResource::fillPaintingResource(&m_renderer, style, hasFallback);
- else if (resourceMode & ApplyToStrokeMode)
- m_paintingResource = RenderSVGResource::strokePaintingResource(&m_renderer, style, hasFallback);
- else {
- // We're either called for stroking or filling.
- ASSERT_NOT_REACHED();
- }
-
+ m_paintingResource = RenderSVGResource::requestPaintingResource(resourceMode, &m_renderer, style, hasFallback);
if (!m_paintingResource)
return false;
- if (!m_paintingResource->applyResource(&m_renderer, style, context, resourceMode)) {
+ if (!m_paintingResource->applyResource(&m_renderer, style, context, resourceModeFlags)) {
if (hasFallback) {
m_paintingResource = RenderSVGResource::sharedSolidPaintingResource();
- m_paintingResource->applyResource(&m_renderer, style, context, resourceMode);
+ m_paintingResource->applyResource(&m_renderer, style, context, resourceModeFlags);
}
}
- if (scalingFactor != 1 && resourceMode & ApplyToStrokeMode)
+ if (scalingFactor != 1 && resourceModeFlags & ApplyToStrokeMode)
context->setStrokeThickness(context->strokeThickness() * scalingFactor);
#if ENABLE(SVG_FONTS)
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.cpp ('k') | Source/core/rendering/svg/SVGRenderTreeAsText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698