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 11 matching lines...) Expand all Loading... |
22 #include "core/layout/svg/LayoutSVGResourcePattern.h" | 22 #include "core/layout/svg/LayoutSVGResourcePattern.h" |
23 | 23 |
24 #include "core/layout/svg/SVGLayoutSupport.h" | 24 #include "core/layout/svg/SVGLayoutSupport.h" |
25 #include "core/layout/svg/SVGResources.h" | 25 #include "core/layout/svg/SVGResources.h" |
26 #include "core/paint/SVGPaintContext.h" | 26 #include "core/paint/SVGPaintContext.h" |
27 #include "core/paint/TransformRecorder.h" | 27 #include "core/paint/TransformRecorder.h" |
28 #include "core/svg/SVGFitToViewBox.h" | 28 #include "core/svg/SVGFitToViewBox.h" |
29 #include "core/svg/SVGPatternElement.h" | 29 #include "core/svg/SVGPatternElement.h" |
30 #include "platform/graphics/GraphicsContext.h" | 30 #include "platform/graphics/GraphicsContext.h" |
31 #include "platform/graphics/paint/PaintController.h" | 31 #include "platform/graphics/paint/PaintController.h" |
| 32 #include "platform/graphics/paint/PaintRecord.h" |
32 #include "platform/graphics/paint/SkPictureBuilder.h" | 33 #include "platform/graphics/paint/SkPictureBuilder.h" |
33 #include "third_party/skia/include/core/SkPicture.h" | |
34 #include "wtf/PtrUtil.h" | 34 #include "wtf/PtrUtil.h" |
35 #include <memory> | 35 #include <memory> |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 struct PatternData { | 39 struct PatternData { |
40 USING_FAST_MALLOC(PatternData); | 40 USING_FAST_MALLOC(PatternData); |
41 | 41 |
42 public: | 42 public: |
43 RefPtr<Pattern> pattern; | 43 RefPtr<Pattern> pattern; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 break; | 179 break; |
180 if (linkedResource == expectedLayoutObject) | 180 if (linkedResource == expectedLayoutObject) |
181 return expectedLayoutObject; | 181 return expectedLayoutObject; |
182 contentLayoutObject = linkedResource; | 182 contentLayoutObject = linkedResource; |
183 } | 183 } |
184 // There was a cycle, just use this resource as the "content resource" even | 184 // There was a cycle, just use this resource as the "content resource" even |
185 // though it will be empty (have no children). | 185 // though it will be empty (have no children). |
186 return this; | 186 return this; |
187 } | 187 } |
188 | 188 |
189 sk_sp<SkPicture> LayoutSVGResourcePattern::asPicture( | 189 sk_sp<PaintRecord> LayoutSVGResourcePattern::asPicture( |
190 const FloatRect& tileBounds, | 190 const FloatRect& tileBounds, |
191 const AffineTransform& tileTransform) const { | 191 const AffineTransform& tileTransform) const { |
192 ASSERT(!m_shouldCollectPatternAttributes); | 192 ASSERT(!m_shouldCollectPatternAttributes); |
193 | 193 |
194 AffineTransform contentTransform; | 194 AffineTransform contentTransform; |
195 if (attributes().patternContentUnits() == | 195 if (attributes().patternContentUnits() == |
196 SVGUnitTypes::kSvgUnitTypeObjectboundingbox) | 196 SVGUnitTypes::kSvgUnitTypeObjectboundingbox) |
197 contentTransform = tileTransform; | 197 contentTransform = tileTransform; |
198 | 198 |
199 FloatRect bounds(FloatPoint(), tileBounds.size()); | 199 FloatRect bounds(FloatPoint(), tileBounds.size()); |
(...skipping 10 matching lines...) Expand all Loading... |
210 *patternLayoutObject, tileTransform); | 210 *patternLayoutObject, tileTransform); |
211 for (LayoutObject* child = patternLayoutObject->firstChild(); child; | 211 for (LayoutObject* child = patternLayoutObject->firstChild(); child; |
212 child = child->nextSibling()) | 212 child = child->nextSibling()) |
213 SVGPaintContext::paintSubtree(pictureBuilder.context(), child); | 213 SVGPaintContext::paintSubtree(pictureBuilder.context(), child); |
214 } | 214 } |
215 | 215 |
216 return pictureBuilder.endRecording(); | 216 return pictureBuilder.endRecording(); |
217 } | 217 } |
218 | 218 |
219 } // namespace blink | 219 } // namespace blink |
OLD | NEW |