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

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

Issue 1841833002: Deal gracefully with null {GraphicsContext,SkPictureBuilder}.endRecording() results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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) 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 29 matching lines...) Expand all
40 FloatRect resourceBoundingBox(const LayoutObject*); 40 FloatRect resourceBoundingBox(const LayoutObject*);
41 41
42 static const LayoutSVGResourceType s_resourceType = ClipperResourceType; 42 static const LayoutSVGResourceType s_resourceType = ClipperResourceType;
43 LayoutSVGResourceType resourceType() const override { return s_resourceType; } 43 LayoutSVGResourceType resourceType() const override { return s_resourceType; }
44 44
45 bool hitTestClipContent(const FloatRect&, const FloatPoint&); 45 bool hitTestClipContent(const FloatRect&, const FloatPoint&);
46 46
47 SVGUnitTypes::SVGUnitType clipPathUnits() const { return toSVGClipPathElemen t(element())->clipPathUnits()->currentValue()->enumValue(); } 47 SVGUnitTypes::SVGUnitType clipPathUnits() const { return toSVGClipPathElemen t(element())->clipPathUnits()->currentValue()->enumValue(); }
48 48
49 bool asPath(const AffineTransform&, const FloatRect& referenceBox, Path&); 49 bool asPath(const AffineTransform&, const FloatRect& referenceBox, Path&);
50 // Returns a picture to paint the contents of the resource, or nullptr if th e picture couldn't be created.
chrishtr 2016/03/29 22:42:23 Add a sentence that the second scenario should onl
wkorman 2016/03/29 22:52:02 Done.
50 PassRefPtr<const SkPicture> createContentPicture(); 51 PassRefPtr<const SkPicture> createContentPicture();
51 52
52 bool hasCycle() { return m_inClipExpansion; } 53 bool hasCycle() { return m_inClipExpansion; }
53 void beginClipExpansion() { ASSERT(!m_inClipExpansion); m_inClipExpansion = true; } 54 void beginClipExpansion() { ASSERT(!m_inClipExpansion); m_inClipExpansion = true; }
54 void endClipExpansion() { ASSERT(m_inClipExpansion); m_inClipExpansion = fal se; } 55 void endClipExpansion() { ASSERT(m_inClipExpansion); m_inClipExpansion = fal se; }
55 private: 56 private:
56 void calculateClipContentPaintInvalidationRect(); 57 void calculateClipContentPaintInvalidationRect();
57 58
58 // Return true if the clip path was calculated or a cached value is availabl e. 59 // Return true if the clip path was calculated or a cached value is availabl e.
59 bool calculateClipContentPathIfNeeded(); 60 bool calculateClipContentPathIfNeeded();
60 61
61 // Cache of the clip path when using path clipping. 62 // Cache of the clip path when using path clipping.
62 Path m_clipContentPath; 63 Path m_clipContentPath;
63 64
64 // Cache of the clip path picture when falling back to masking for clipping. 65 // Cache of the clip path picture when falling back to masking for clipping.
65 RefPtr<const SkPicture> m_clipContentPicture; 66 RefPtr<const SkPicture> m_clipContentPicture;
66 67
67 FloatRect m_clipBoundaries; 68 FloatRect m_clipBoundaries;
68 69
69 // Reference cycle detection. 70 // Reference cycle detection.
70 bool m_inClipExpansion; 71 bool m_inClipExpansion;
71 }; 72 };
72 73
73 DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(LayoutSVGResourceClipper, ClipperResourceT ype); 74 DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(LayoutSVGResourceClipper, ClipperResourceT ype);
74 75
75 } // namespace blink 76 } // namespace blink
76 77
77 #endif 78 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698