| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) | 74 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) |
| 75 displayItemList = DisplayItemList::create(); | 75 displayItemList = DisplayItemList::create(); |
| 76 GraphicsContext context(nullptr, displayItemList.get()); | 76 GraphicsContext context(nullptr, displayItemList.get()); |
| 77 context.beginRecording(bounds); | 77 context.beginRecording(bounds); |
| 78 | 78 |
| 79 ColorFilter maskContentFilter = style()->svgStyle().colorInterpolation() ==
CI_LINEARRGB | 79 ColorFilter maskContentFilter = style()->svgStyle().colorInterpolation() ==
CI_LINEARRGB |
| 80 ? ColorFilterSRGBToLinearRGB : ColorFilterNone; | 80 ? ColorFilterSRGBToLinearRGB : ColorFilterNone; |
| 81 context.setColorFilter(maskContentFilter); | 81 context.setColorFilter(maskContentFilter); |
| 82 | 82 |
| 83 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { | 83 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { |
| 84 LayoutObject* renderer = childElement->renderer(); | 84 LayoutObject* renderer = childElement->layoutObject(); |
| 85 if (!renderer) | 85 if (!renderer) |
| 86 continue; | 86 continue; |
| 87 const LayoutStyle* style = renderer->style(); | 87 const LayoutStyle* style = renderer->style(); |
| 88 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) | 88 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) |
| 89 continue; | 89 continue; |
| 90 | 90 |
| 91 SVGPaintContext::paintSubtree(&context, renderer); | 91 SVGPaintContext::paintSubtree(&context, renderer); |
| 92 } | 92 } |
| 93 | 93 |
| 94 if (displayItemList) | 94 if (displayItemList) |
| 95 displayItemList->replay(&context); | 95 displayItemList->replay(&context); |
| 96 m_maskContentPicture = context.endRecording(); | 96 m_maskContentPicture = context.endRecording(); |
| 97 return m_maskContentPicture; | 97 return m_maskContentPicture; |
| 98 } | 98 } |
| 99 | 99 |
| 100 void LayoutSVGResourceMasker::calculateMaskContentPaintInvalidationRect() | 100 void LayoutSVGResourceMasker::calculateMaskContentPaintInvalidationRect() |
| 101 { | 101 { |
| 102 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { | 102 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { |
| 103 LayoutObject* renderer = childElement->renderer(); | 103 LayoutObject* renderer = childElement->layoutObject(); |
| 104 if (!renderer) | 104 if (!renderer) |
| 105 continue; | 105 continue; |
| 106 const LayoutStyle* style = renderer->style(); | 106 const LayoutStyle* style = renderer->style(); |
| 107 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) | 107 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) |
| 108 continue; | 108 continue; |
| 109 m_maskContentBoundaries.unite(renderer->localToParentTransform().mapRect
(renderer->paintInvalidationRectInLocalCoordinates())); | 109 m_maskContentBoundaries.unite(renderer->localToParentTransform().mapRect
(renderer->paintInvalidationRectInLocalCoordinates())); |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 FloatRect LayoutSVGResourceMasker::resourceBoundingBox(const LayoutObject* objec
t) | 113 FloatRect LayoutSVGResourceMasker::resourceBoundingBox(const LayoutObject* objec
t) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 131 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); | 131 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); |
| 132 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); | 132 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); |
| 133 maskRect = transform.mapRect(maskRect); | 133 maskRect = transform.mapRect(maskRect); |
| 134 } | 134 } |
| 135 | 135 |
| 136 maskRect.intersect(maskBoundaries); | 136 maskRect.intersect(maskBoundaries); |
| 137 return maskRect; | 137 return maskRect; |
| 138 } | 138 } |
| 139 | 139 |
| 140 } | 140 } |
| OLD | NEW |