| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 4 * Copyright 2014 The Chromium Authors. All rights reserved. | 4 * Copyright 2014 The Chromium Authors. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 const FloatRect& tileBounds, | 196 const FloatRect& tileBounds, |
| 197 const AffineTransform& tileTransform) const { | 197 const AffineTransform& tileTransform) const { |
| 198 DCHECK(!m_shouldCollectPatternAttributes); | 198 DCHECK(!m_shouldCollectPatternAttributes); |
| 199 | 199 |
| 200 AffineTransform contentTransform; | 200 AffineTransform contentTransform; |
| 201 if (attributes().patternContentUnits() == | 201 if (attributes().patternContentUnits() == |
| 202 SVGUnitTypes::kSvgUnitTypeObjectboundingbox) | 202 SVGUnitTypes::kSvgUnitTypeObjectboundingbox) |
| 203 contentTransform = tileTransform; | 203 contentTransform = tileTransform; |
| 204 | 204 |
| 205 FloatRect bounds(FloatPoint(), tileBounds.size()); | 205 FloatRect bounds(FloatPoint(), tileBounds.size()); |
| 206 PaintRecordBuilder builder(bounds); | |
| 207 | |
| 208 const LayoutSVGResourceContainer* patternLayoutObject = | 206 const LayoutSVGResourceContainer* patternLayoutObject = |
| 209 resolveContentElement(); | 207 resolveContentElement(); |
| 210 DCHECK(patternLayoutObject); | 208 DCHECK(patternLayoutObject); |
| 211 DCHECK(!patternLayoutObject->needsLayout()); | 209 DCHECK(!patternLayoutObject->needsLayout()); |
| 212 | 210 |
| 213 SubtreeContentTransformScope contentTransformScope(contentTransform); | 211 SubtreeContentTransformScope contentTransformScope(contentTransform); |
| 214 | 212 |
| 215 { | 213 PaintRecordBuilder builder(bounds); |
| 216 TransformRecorder transformRecorder(builder.context(), *patternLayoutObject, | 214 for (LayoutObject* child = patternLayoutObject->firstChild(); child; |
| 217 tileTransform); | 215 child = child->nextSibling()) |
| 218 for (LayoutObject* child = patternLayoutObject->firstChild(); child; | 216 SVGPaintContext::paintResourceSubtree(builder.context(), child); |
| 219 child = child->nextSibling()) | 217 PaintRecorder paintRecorder; |
| 220 SVGPaintContext::paintResourceSubtree(builder.context(), child); | 218 PaintCanvas* canvas = paintRecorder.beginRecording(bounds); |
| 221 } | 219 canvas->save(); |
| 222 | 220 canvas->concat(affineTransformToSkMatrix(tileTransform)); |
| 223 return builder.endRecording(); | 221 canvas->drawPicture(builder.endRecording()); |
| 222 canvas->restore(); |
| 223 return paintRecorder.finishRecordingAsPicture(); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace blink | 226 } // namespace blink |
| OLD | NEW |