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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceClipper.cpp

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: Clean up comments, fix mac build Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org>
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 10 matching lines...) Expand all
21 */ 21 */
22 22
23 #include "core/layout/svg/LayoutSVGResourceClipper.h" 23 #include "core/layout/svg/LayoutSVGResourceClipper.h"
24 24
25 #include "core/dom/ElementTraversal.h" 25 #include "core/dom/ElementTraversal.h"
26 #include "core/layout/HitTestResult.h" 26 #include "core/layout/HitTestResult.h"
27 #include "core/layout/svg/SVGLayoutSupport.h" 27 #include "core/layout/svg/SVGLayoutSupport.h"
28 #include "core/paint/PaintInfo.h" 28 #include "core/paint/PaintInfo.h"
29 #include "core/svg/SVGGeometryElement.h" 29 #include "core/svg/SVGGeometryElement.h"
30 #include "core/svg/SVGUseElement.h" 30 #include "core/svg/SVGUseElement.h"
31 #include "platform/graphics/paint/PaintRecord.h"
31 #include "platform/graphics/paint/SkPictureBuilder.h" 32 #include "platform/graphics/paint/SkPictureBuilder.h"
32 #include "third_party/skia/include/core/SkPicture.h"
33 #include "third_party/skia/include/pathops/SkPathOps.h" 33 #include "third_party/skia/include/pathops/SkPathOps.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 namespace { 37 namespace {
38 38
39 enum class ClipStrategy { None, Mask, Path }; 39 enum class ClipStrategy { None, Mask, Path };
40 40
41 ClipStrategy modifyStrategyForClipPath(const ComputedStyle& style, 41 ClipStrategy modifyStrategyForClipPath(const ComputedStyle& style,
42 ClipStrategy strategy) { 42 ClipStrategy strategy) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 transform.translate(referenceBox.x(), referenceBox.y()); 197 transform.translate(referenceBox.x(), referenceBox.y());
198 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); 198 transform.scaleNonUniform(referenceBox.width(), referenceBox.height());
199 clipPath.transform(transform); 199 clipPath.transform(transform);
200 } 200 }
201 201
202 // Transform path by animatedLocalTransform. 202 // Transform path by animatedLocalTransform.
203 clipPath.transform(animatedLocalTransform); 203 clipPath.transform(animatedLocalTransform);
204 return true; 204 return true;
205 } 205 }
206 206
207 sk_sp<const SkPicture> LayoutSVGResourceClipper::createContentPicture() { 207 sk_sp<const PaintRecord> LayoutSVGResourceClipper::createContentPicture() {
208 ASSERT(frame()); 208 ASSERT(frame());
209 if (m_clipContentPicture) 209 if (m_clipContentPicture)
210 return m_clipContentPicture; 210 return m_clipContentPicture;
211 211
212 // Using strokeBoundingBox (instead of visualRectInLocalSVGCoordinates) to 212 // Using strokeBoundingBox (instead of visualRectInLocalSVGCoordinates) to
213 // avoid the intersection with local clips/mask, which may yield incorrect 213 // avoid the intersection with local clips/mask, which may yield incorrect
214 // results when mixing objectBoundingBox and userSpaceOnUse units 214 // results when mixing objectBoundingBox and userSpaceOnUse units
215 // (http://crbug.com/294900). 215 // (http://crbug.com/294900).
216 FloatRect bounds = strokeBoundingBox(); 216 FloatRect bounds = strokeBoundingBox();
217 217
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 toSVGClipPathElement(element())->calculateTransform( 302 toSVGClipPathElement(element())->calculateTransform(
303 SVGElement::IncludeMotionTransform); 303 SVGElement::IncludeMotionTransform);
304 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { 304 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) {
305 transform.translate(referenceBox.x(), referenceBox.y()); 305 transform.translate(referenceBox.x(), referenceBox.y());
306 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); 306 transform.scaleNonUniform(referenceBox.width(), referenceBox.height());
307 } 307 }
308 return transform.mapRect(m_localClipBounds); 308 return transform.mapRect(m_localClipBounds);
309 } 309 }
310 310
311 } // namespace blink 311 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698