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

Unified Diff: Source/core/layout/svg/LayoutSVGResourcePaintServer.cpp

Issue 1070703002: Explicitly use SkPaint(s) in SVGInlineTextBoxPainter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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
Index: Source/core/layout/svg/LayoutSVGResourcePaintServer.cpp
diff --git a/Source/core/layout/svg/LayoutSVGResourcePaintServer.cpp b/Source/core/layout/svg/LayoutSVGResourcePaintServer.cpp
index aa189b7018e9e7a96f162bae0c5e0a88b27af6cc..e56ddbdae80cb9d246596e5eaf56f650930930ad 100644
--- a/Source/core/layout/svg/LayoutSVGResourcePaintServer.cpp
+++ b/Source/core/layout/svg/LayoutSVGResourcePaintServer.cpp
@@ -26,8 +26,7 @@
#include "core/style/ComputedStyle.h"
#include "core/layout/svg/SVGResources.h"
#include "core/layout/svg/SVGResourcesCache.h"
-#include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/graphics/skia/SkiaUtils.h"
#include "third_party/skia/include/core/SkPaint.h"
namespace blink {
@@ -61,30 +60,6 @@ void SVGPaintServer::applyToSkPaint(SkPaint& paint, float paintAlpha)
paint.setShader(nullptr);
}
-void SVGPaintServer::apply(GraphicsContext& context, LayoutSVGResourceMode resourceMode, float paintAlpha, GraphicsContextStateSaver& stateSaver)
-{
- ASSERT(resourceMode == ApplyToFillMode || resourceMode == ApplyToStrokeMode);
-
- if (m_gradient || m_pattern)
- stateSaver.saveIfNeeded();
-
- if (resourceMode == ApplyToFillMode) {
- if (m_pattern)
- context.setFillPattern(m_pattern, paintAlpha);
- else if (m_gradient)
- context.setFillGradient(m_gradient, paintAlpha);
- else
- context.setFillColor(scaleAlpha(m_color.rgb(), paintAlpha));
- } else {
- if (m_pattern)
- context.setStrokePattern(m_pattern, paintAlpha);
- else if (m_gradient)
- context.setStrokeGradient(m_gradient, paintAlpha);
- else
- context.setStrokeColor(scaleAlpha(m_color.rgb(), paintAlpha));
- }
-}
-
void SVGPaintServer::prependTransform(const AffineTransform& transform)
{
ASSERT(m_gradient || m_pattern);

Powered by Google App Engine
This is Rietveld 408576698