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

Side by Side Diff: Source/core/rendering/svg/SVGRenderSupport.cpp

Issue 657553002: Fold SVGRenderSupport::fillOrStrokePath into only user (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 25 matching lines...) Expand all
36 #include "core/rendering/svg/RenderSVGResourceFilter.h" 36 #include "core/rendering/svg/RenderSVGResourceFilter.h"
37 #include "core/rendering/svg/RenderSVGResourceMasker.h" 37 #include "core/rendering/svg/RenderSVGResourceMasker.h"
38 #include "core/rendering/svg/RenderSVGRoot.h" 38 #include "core/rendering/svg/RenderSVGRoot.h"
39 #include "core/rendering/svg/RenderSVGShape.h" 39 #include "core/rendering/svg/RenderSVGShape.h"
40 #include "core/rendering/svg/RenderSVGText.h" 40 #include "core/rendering/svg/RenderSVGText.h"
41 #include "core/rendering/svg/RenderSVGViewportContainer.h" 41 #include "core/rendering/svg/RenderSVGViewportContainer.h"
42 #include "core/rendering/svg/SVGResources.h" 42 #include "core/rendering/svg/SVGResources.h"
43 #include "core/rendering/svg/SVGResourcesCache.h" 43 #include "core/rendering/svg/SVGResourcesCache.h"
44 #include "core/svg/SVGElement.h" 44 #include "core/svg/SVGElement.h"
45 #include "platform/geometry/TransformState.h" 45 #include "platform/geometry/TransformState.h"
46 #include "platform/graphics/Path.h"
47 46
48 namespace blink { 47 namespace blink {
49 48
50 LayoutRect SVGRenderSupport::clippedOverflowRectForPaintInvalidation(const Rende rObject* object, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) 49 LayoutRect SVGRenderSupport::clippedOverflowRectForPaintInvalidation(const Rende rObject* object, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState)
51 { 50 {
52 // Return early for any cases where we don't actually paint 51 // Return early for any cases where we don't actually paint
53 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h asVisibleContent()) 52 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h asVisibleContent())
54 return LayoutRect(); 53 return LayoutRect();
55 54
56 // Pass our local paint rect to computeRectForPaintInvalidation() which will 55 // Pass our local paint rect to computeRectForPaintInvalidation() which will
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 if (resourceMode == ApplyToFillMode) { 419 if (resourceMode == ApplyToFillMode) {
421 context->setAlphaAsFloat(svgStyle.fillOpacity()); 420 context->setAlphaAsFloat(svgStyle.fillOpacity());
422 context->setFillRule(svgStyle.fillRule()); 421 context->setFillRule(svgStyle.fillRule());
423 } else { 422 } else {
424 context->setAlphaAsFloat(svgStyle.strokeOpacity()); 423 context->setAlphaAsFloat(svgStyle.strokeOpacity());
425 applyStrokeStyleToContext(context, style, &renderer); 424 applyStrokeStyleToContext(context, style, &renderer);
426 } 425 }
427 return true; 426 return true;
428 } 427 }
429 428
430 void SVGRenderSupport::fillOrStrokePath(GraphicsContext* context, unsigned short resourceMode, const Path& path)
431 {
432 if (resourceMode & ApplyToFillMode)
433 context->fillPath(path);
434 if (resourceMode & ApplyToStrokeMode)
435 context->strokePath(path);
436 }
437
438 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) 429 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object)
439 { 430 {
440 ASSERT(object->isText()); 431 ASSERT(object->isText());
441 // <br> is marked as text, but is not handled by the SVG rendering code-path . 432 // <br> is marked as text, but is not handled by the SVG rendering code-path .
442 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text(); 433 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text();
443 } 434 }
444 435
445 } 436 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGRenderSupport.h ('k') | Source/core/rendering/svg/SVGTextRunRenderingContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698