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

Side by Side Diff: Source/core/rendering/shapes/ShapeOutsideInfo.h

Issue 237313003: CSS shapes support in Web Inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review comments Created 6 years, 7 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) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 InfoMap::AddResult result = infoMap.add(&key, ShapeOutsideInfo::createIn fo(key)); 82 InfoMap::AddResult result = infoMap.add(&key, ShapeOutsideInfo::createIn fo(key));
83 return *result.storedValue->value; 83 return *result.storedValue->value;
84 } 84 }
85 static void removeInfo(const RenderBox& key) { infoMap().remove(&key); } 85 static void removeInfo(const RenderBox& key) { infoMap().remove(&key); }
86 static ShapeOutsideInfo* info(const RenderBox& key) { return infoMap().get(& key); } 86 static ShapeOutsideInfo* info(const RenderBox& key) { return infoMap().get(& key); }
87 87
88 void markShapeAsDirty() { m_shape.clear(); } 88 void markShapeAsDirty() { m_shape.clear(); }
89 bool isShapeDirty() { return !m_shape.get(); } 89 bool isShapeDirty() { return !m_shape.get(); }
90 LayoutSize shapeSize() const { return m_referenceBoxLogicalSize; } 90 LayoutSize shapeSize() const { return m_referenceBoxLogicalSize; }
91 91
92 private: 92 LayoutRect computedShapePhysicalBoundingBox() const;
93 FloatPoint shapeToRendererPoint(FloatPoint) const;
94 FloatSize shapeToRendererSize(FloatSize) const;
95 const Shape& computedShape() const;
96
97 protected:
93 ShapeOutsideInfo(const RenderBox& renderer) 98 ShapeOutsideInfo(const RenderBox& renderer)
94 : m_renderer(renderer) 99 : m_renderer(renderer)
95 , m_lineOverlapsShape(false) 100 , m_lineOverlapsShape(false)
96 { } 101 { }
97 102
98 const Shape& computedShape() const; 103 private:
99
100 LayoutUnit logicalTopOffset() const; 104 LayoutUnit logicalTopOffset() const;
101 LayoutUnit logicalLeftOffset() const; 105 LayoutUnit logicalLeftOffset() const;
102 106
103 typedef HashMap<const RenderBox*, OwnPtr<ShapeOutsideInfo> > InfoMap; 107 typedef HashMap<const RenderBox*, OwnPtr<ShapeOutsideInfo> > InfoMap;
104 static InfoMap& infoMap() 108 static InfoMap& infoMap()
105 { 109 {
106 DEFINE_STATIC_LOCAL(InfoMap, staticInfoMap, ()); 110 DEFINE_STATIC_LOCAL(InfoMap, staticInfoMap, ());
107 return staticInfoMap; 111 return staticInfoMap;
108 } 112 }
109 113
110 LayoutUnit m_referenceBoxLineTop; 114 LayoutUnit m_referenceBoxLineTop;
111 LayoutUnit m_lineHeight; 115 LayoutUnit m_lineHeight;
112 116
113 const RenderBox& m_renderer; 117 const RenderBox& m_renderer;
114 mutable OwnPtr<Shape> m_shape; 118 mutable OwnPtr<Shape> m_shape;
115 LayoutSize m_referenceBoxLogicalSize; 119 LayoutSize m_referenceBoxLogicalSize;
116 LayoutUnit m_leftMarginBoxDelta; 120 LayoutUnit m_leftMarginBoxDelta;
117 LayoutUnit m_rightMarginBoxDelta; 121 LayoutUnit m_rightMarginBoxDelta;
118 LayoutUnit m_borderBoxLineTop; 122 LayoutUnit m_borderBoxLineTop;
119 bool m_lineOverlapsShape; 123 bool m_lineOverlapsShape;
120 }; 124 };
121 125
122 } 126 }
123 #endif 127 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698