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

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

Issue 571463002: Factor out common code from RenderSVGResource*::postApplyResource (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/svg/SVGRenderSupport.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 16 matching lines...) Expand all
27 27
28 #include "core/rendering/PaintInfo.h" 28 #include "core/rendering/PaintInfo.h"
29 #include "core/rendering/RenderGeometryMap.h" 29 #include "core/rendering/RenderGeometryMap.h"
30 #include "core/rendering/RenderLayer.h" 30 #include "core/rendering/RenderLayer.h"
31 #include "core/rendering/SubtreeLayoutScope.h" 31 #include "core/rendering/SubtreeLayoutScope.h"
32 #include "core/rendering/svg/RenderSVGInlineText.h" 32 #include "core/rendering/svg/RenderSVGInlineText.h"
33 #include "core/rendering/svg/RenderSVGResourceClipper.h" 33 #include "core/rendering/svg/RenderSVGResourceClipper.h"
34 #include "core/rendering/svg/RenderSVGResourceFilter.h" 34 #include "core/rendering/svg/RenderSVGResourceFilter.h"
35 #include "core/rendering/svg/RenderSVGResourceMasker.h" 35 #include "core/rendering/svg/RenderSVGResourceMasker.h"
36 #include "core/rendering/svg/RenderSVGRoot.h" 36 #include "core/rendering/svg/RenderSVGRoot.h"
37 #include "core/rendering/svg/RenderSVGShape.h"
37 #include "core/rendering/svg/RenderSVGText.h" 38 #include "core/rendering/svg/RenderSVGText.h"
38 #include "core/rendering/svg/RenderSVGViewportContainer.h" 39 #include "core/rendering/svg/RenderSVGViewportContainer.h"
39 #include "core/rendering/svg/SVGResources.h" 40 #include "core/rendering/svg/SVGResources.h"
40 #include "core/rendering/svg/SVGResourcesCache.h" 41 #include "core/rendering/svg/SVGResourcesCache.h"
41 #include "core/svg/SVGElement.h" 42 #include "core/svg/SVGElement.h"
42 #include "platform/geometry/TransformState.h" 43 #include "platform/geometry/TransformState.h"
44 #include "platform/graphics/Path.h"
43 45
44 namespace blink { 46 namespace blink {
45 47
46 LayoutRect SVGRenderSupport::clippedOverflowRectForPaintInvalidation(const Rende rObject* object, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) 48 LayoutRect SVGRenderSupport::clippedOverflowRectForPaintInvalidation(const Rende rObject* object, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState)
47 { 49 {
48 // Return early for any cases where we don't actually paint 50 // Return early for any cases where we don't actually paint
49 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h asVisibleContent()) 51 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h asVisibleContent())
50 return LayoutRect(); 52 return LayoutRect();
51 53
52 // Pass our local paint rect to computeRectForPaintInvalidation() which will 54 // Pass our local paint rect to computeRectForPaintInvalidation() which will
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 return; 358 return;
357 359
358 DashArray dashArray; 360 DashArray dashArray;
359 size_t length = dashes->length(); 361 size_t length = dashes->length();
360 for (size_t i = 0; i < length; ++i) 362 for (size_t i = 0; i < length; ++i)
361 dashArray.append(dashes->at(i)->value(lengthContext)); 363 dashArray.append(dashes->at(i)->value(lengthContext));
362 364
363 strokeData->setLineDash(dashArray, svgStyle.strokeDashOffset()->value(length Context)); 365 strokeData->setLineDash(dashArray, svgStyle.strokeDashOffset()->value(length Context));
364 } 366 }
365 367
368 void SVGRenderSupport::fillOrStrokePrimitive(GraphicsContext* context, unsigned short resourceMode, const Path* path, const RenderSVGShape* shape)
369 {
370 ASSERT(resourceMode != ApplyToDefaultMode);
371
372 if (resourceMode & ApplyToFillMode) {
373 if (path)
374 context->fillPath(*path);
375 else if (shape)
376 shape->fillShape(context);
377 }
378 if (resourceMode & ApplyToStrokeMode) {
379 if (path)
380 context->strokePath(*path);
381 else if (shape)
382 shape->strokeShape(context);
383 }
384 }
385
366 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) 386 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object)
367 { 387 {
368 ASSERT(object->isText()); 388 ASSERT(object->isText());
369 // <br> is marked as text, but is not handled by the SVG rendering code-path . 389 // <br> is marked as text, but is not handled by the SVG rendering code-path .
370 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text(); 390 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text();
371 } 391 }
372 392
373 } 393 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGRenderSupport.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698