Changeset 224312 in webkit
- Timestamp:
- Nov 1, 2017 8:08:53 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r224277 r224312 1 2017-11-01 Simon Fraser <simon.fraser@apple.com> 2 3 Misc display list and other cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=179150 5 6 Reviewed by Tim Horton. 7 8 Add system trace points for display list recording. 9 10 * wtf/SystemTracing.h: 11 1 12 2017-11-01 Fujii Hironori <Hironori.Fujii@sony.com> 2 13 -
trunk/Source/WTF/wtf/SystemTracing.h
r215967 r224312 72 72 UpdateTouchRegionsStart, 73 73 UpdateTouchRegionsEnd, 74 DisplayListRecordStart, 75 DisplayListRecordEnd, 74 76 75 77 WebKitRange = 10000, -
trunk/Source/WebCore/ChangeLog
r224311 r224312 1 2017-11-01 Simon Fraser <simon.fraser@apple.com> 2 3 Misc display list and other cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=179150 5 6 Reviewed by Tim Horton. 7 8 A few functions in GraphicsContext would assert when using display lists, because they 9 had no recording clause. Fix them (ellipse drawing, and focus ring drawing). 10 11 Use #pragma once in more places. 12 13 Add system trace points for display list recording. 14 15 No behavior change for non-display list code. 16 17 * platform/graphics/GraphicsContext.cpp: 18 (WebCore::GraphicsContext::fillEllipse): 19 (WebCore::GraphicsContext::strokeEllipse): 20 * platform/graphics/PlatformLayer.h: 21 * platform/graphics/ca/GraphicsLayerCA.cpp: 22 (WebCore::GraphicsLayerCA::recursiveCommitChanges): 23 * platform/graphics/ca/cocoa/WebSystemBackdropLayer.h: 24 * platform/graphics/ca/cocoa/WebTiledBackingLayer.h: 25 * platform/graphics/cg/GraphicsContextCG.h: 26 * platform/graphics/cocoa/GraphicsContextCocoa.mm: 27 (WebCore::GraphicsContext::drawFocusRing): 28 * platform/graphics/displaylists/DisplayList.h: 29 * platform/graphics/displaylists/DisplayListItems.h: 30 (WebCore::DisplayList::DrawFocusRingPath::create): 31 (WebCore::DisplayList::DrawFocusRingPath::width const): 32 (WebCore::DisplayList::DrawFocusRingPath::offset const): 33 (WebCore::DisplayList::DrawFocusRingPath::DrawFocusRingPath): 34 (WebCore::DisplayList::DrawFocusRingRects::create): 35 (WebCore::DisplayList::DrawFocusRingRects::width const): 36 (WebCore::DisplayList::DrawFocusRingRects::offset const): 37 (WebCore::DisplayList::DrawFocusRingRects::DrawFocusRingRects): 38 * platform/graphics/displaylists/DisplayListRecorder.cpp: 39 (WebCore::DisplayList::Recorder::restore): 40 (WebCore::DisplayList::Recorder::drawFocusRing): 41 * platform/graphics/displaylists/DisplayListRecorder.h: 42 * platform/graphics/displaylists/DisplayListReplayer.h: 43 * platform/graphics/mac/WebLayer.h: 44 1 45 2017-11-01 Per Arne Vollan <pvollan@apple.com> 2 46 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r222253 r224312 1046 1046 void GraphicsContext::fillEllipse(const FloatRect& ellipse) 1047 1047 { 1048 if (isRecording()) { 1049 m_displayListRecorder->fillEllipse(ellipse); 1050 return; 1051 } 1052 1048 1053 platformFillEllipse(ellipse); 1049 1054 } … … 1051 1056 void GraphicsContext::strokeEllipse(const FloatRect& ellipse) 1052 1057 { 1058 if (isRecording()) { 1059 m_displayListRecorder->strokeEllipse(ellipse); 1060 return; 1061 } 1062 1053 1063 platformStrokeEllipse(ellipse); 1054 1064 } -
trunk/Source/WebCore/platform/graphics/PlatformLayer.h
r193630 r224312 24 24 */ 25 25 26 #ifndef PlatformLayer_h 27 #define PlatformLayer_h 26 #pragma once 28 27 29 28 #if PLATFORM(COCOA) … … 46 45 #endif 47 46 48 #endif // PlatformLayer_h -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r224198 r224312 1545 1545 1546 1546 if (usesDisplayListDrawing() && m_drawsContent && (!m_hasEverPainted || hadDirtyRects)) { 1547 #ifdef LOG_RECORDING_TIME 1548 double startTime = currentTime(); 1549 #endif 1547 TraceScope tracingScope(DisplayListRecordStart, DisplayListRecordEnd); 1548 1550 1549 m_displayList = std::make_unique<DisplayList::DisplayList>(); 1551 1550 … … 1556 1555 std::unique_ptr<DisplayList::Recorder> recorder = std::make_unique<DisplayList::Recorder>(context, *m_displayList, initialClip, AffineTransform()); 1557 1556 paintGraphicsLayerContents(context, FloatRect(FloatPoint(), size())); 1558 1559 #ifdef LOG_RECORDING_TIME1560 double duration = currentTime() - startTime;1561 WTFLogAlways("Recording took %.5fms", duration * 1000.0);1562 #endif1563 1557 } 1564 1558 } -
trunk/Source/WebCore/platform/graphics/ca/cocoa/WebSystemBackdropLayer.h
r185888 r224312 24 24 */ 25 25 26 #ifndef WebSystemBackdropLayer_h 27 #define WebSystemBackdropLayer_h 26 #pragma once 28 27 29 28 #import <QuartzCore/QuartzCore.h> … … 38 37 @end 39 38 40 #endif // WebSystemBackdropLayer_h -
trunk/Source/WebCore/platform/graphics/ca/cocoa/WebTiledBackingLayer.h
r212776 r224312 24 24 */ 25 25 26 #ifndef WebTiledBackingLayer_h 27 #define WebTiledBackingLayer_h 26 #pragma once 28 27 29 28 #import <QuartzCore/QuartzCore.h> … … 52 51 @end 53 52 54 #endif // WebTiledBackingLayer_h -
trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.h
r208020 r224312 24 24 */ 25 25 26 #ifndef GraphicsContextCG_h 27 #define GraphicsContextCG_h 26 #pragma once 28 27 29 28 #include "GraphicsContext.h" … … 102 101 } 103 102 104 #endif -
trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm
r222898 r224312 27 27 #import "GraphicsContext.h" 28 28 29 #import "DisplayListRecorder.h" 29 30 #import "GraphicsContextCG.h" 30 31 #import "GraphicsContextPlatformPrivateCG.h" … … 113 114 #endif // !PLATFORM(IOS) 114 115 115 void GraphicsContext::drawFocusRing(const Path& path, float /* width */, float /* offset */, const Color&)116 void GraphicsContext::drawFocusRing(const Path& path, float width, float offset, const Color& color) 116 117 { 117 118 #if PLATFORM(MAC) … … 119 120 return; 120 121 122 if (isRecording()) { 123 m_displayListRecorder->drawFocusRing(path, width, offset, color); 124 return; 125 } 126 121 127 drawFocusRingToContext(platformContext(), path.platformPath()); 122 128 #else … … 130 136 if (paintingDisabled() || path.isNull()) 131 137 return; 132 138 139 if (isRecording()) // FIXME: implement animated focus ring drawing. 140 return; 141 133 142 needsRedraw = drawFocusRingToContextAtTime(platformContext(), path.platformPath(), timeOffset); 134 143 } … … 137 146 { 138 147 if (paintingDisabled()) 148 return; 149 150 if (isRecording()) // FIXME: implement animated focus ring drawing. 139 151 return; 140 152 … … 147 159 #endif 148 160 149 void GraphicsContext::drawFocusRing(const Vector<FloatRect>& rects, float , float offset, const Color&)161 void GraphicsContext::drawFocusRing(const Vector<FloatRect>& rects, float width, float offset, const Color& color) 150 162 { 151 163 #if !PLATFORM(IOS) 152 164 if (paintingDisabled()) 153 165 return; 166 167 if (isRecording()) { 168 m_displayListRecorder->drawFocusRing(rects, width, offset, color); 169 return; 170 } 154 171 155 172 RetainPtr<CGMutablePathRef> focusRingPath = adoptCF(CGPathCreateMutable()); -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.h
r220503 r224312 24 24 */ 25 25 26 #ifndef DisplayList_h 27 #define DisplayList_h 26 #pragma once 28 27 29 28 #include "DisplayListItems.h" … … 112 111 using WebCore::DisplayList::DisplayList; 113 112 114 #endif /* DisplayList_h */ -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
r223728 r224312 24 24 */ 25 25 26 #ifndef DisplayListItems_h 27 #define DisplayListItems_h 26 #pragma once 28 27 29 28 #include "FloatPoint.h" … … 905 904 class DrawFocusRingPath : public DrawingItem { 906 905 public: 907 static Ref<DrawFocusRingPath> create(const Path& path, int width, int offset, const Color& color)906 static Ref<DrawFocusRingPath> create(const Path& path, float width, float offset, const Color& color) 908 907 { 909 908 return adoptRef(*new DrawFocusRingPath(path, width, offset, color)); … … 911 910 912 911 const Path& path() const { return m_path; } 913 int width() const { return m_width; }914 int offset() const { return m_offset; }912 float width() const { return m_width; } 913 float offset() const { return m_offset; } 915 914 const Color& color() const { return m_color; } 916 915 917 916 private: 918 DrawFocusRingPath(const Path& path, int width, int offset, const Color& color)917 DrawFocusRingPath(const Path& path, float width, float offset, const Color& color) 919 918 : DrawingItem(ItemType::DrawFocusRingPath) 920 919 , m_path(path) … … 930 929 931 930 const Path m_path; 932 int m_width;933 int m_offset;931 float m_width; 932 float m_offset; 934 933 Color m_color; 935 934 }; … … 937 936 class DrawFocusRingRects : public DrawingItem { 938 937 public: 939 static Ref<DrawFocusRingRects> create(const Vector<FloatRect>& rects, int width, int offset, const Color& color)938 static Ref<DrawFocusRingRects> create(const Vector<FloatRect>& rects, float width, float offset, const Color& color) 940 939 { 941 940 return adoptRef(*new DrawFocusRingRects(rects, width, offset, color)); … … 943 942 944 943 const Vector<FloatRect> rects() const { return m_rects; } 945 int width() const { return m_width; }946 int offset() const { return m_offset; }944 float width() const { return m_width; } 945 float offset() const { return m_offset; } 947 946 const Color& color() const { return m_color; } 948 947 949 948 private: 950 DrawFocusRingRects(const Vector<FloatRect>& rects, int width, int offset, const Color& color)949 DrawFocusRingRects(const Vector<FloatRect>& rects, float width, float offset, const Color& color) 951 950 : DrawingItem(ItemType::DrawFocusRingRects) 952 951 , m_rects(rects) … … 962 961 963 962 Vector<FloatRect> m_rects; 964 int m_width;965 int m_offset;963 float m_width; 964 float m_offset; 966 965 Color m_color; 967 966 }; … … 1388 1387 SPECIALIZE_TYPE_TRAITS_DISPLAYLIST_ITEM(ClearShadow) 1389 1388 1390 #endif // DisplayListItems_h -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp
r220503 r224312 149 149 if (!m_stateStack.size()) 150 150 return; 151 151 152 152 bool stateUsedForDrawing = currentState().wasUsedForDrawing; 153 153 size_t saveIndex = currentState().saveItemIndex; 154 154 155 155 m_stateStack.removeLast(); 156 156 // Have to avoid eliding nested Save/Restore when a descendant state contains drawing items. … … 164 164 165 165 appendItem(Restore::create()); 166 166 167 167 if (saveIndex) { 168 168 Save& saveItem = downcast<Save>(m_displayList.itemAt(saveIndex)); … … 242 242 } 243 243 244 void Recorder::drawFocusRing(const Path& path, int width, int offset, const Color& color)244 void Recorder::drawFocusRing(const Path& path, float width, float offset, const Color& color) 245 245 { 246 246 DrawingItem& newItem = downcast<DrawingItem>(appendItem(DrawFocusRingPath::create(path, width, offset, color))); … … 248 248 } 249 249 250 void Recorder::drawFocusRing(const Vector<FloatRect>& rects, int width, int offset, const Color& color)250 void Recorder::drawFocusRing(const Vector<FloatRect>& rects, float width, float offset, const Color& color) 251 251 { 252 252 DrawingItem& newItem = downcast<DrawingItem>(appendItem(DrawFocusRingRects::create(rects, width, offset, color))); -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h
r206631 r224312 24 24 */ 25 25 26 #ifndef DisplayListRecorder_h 27 #define DisplayListRecorder_h 26 #pragma once 28 27 29 28 #include "DisplayList.h" … … 98 97 void drawPath(const Path&); 99 98 100 void drawFocusRing(const Path&, int width, int offset, const Color&);101 void drawFocusRing(const Vector<FloatRect>&, int width, int offset, const Color&);99 void drawFocusRing(const Path&, float width, float offset, const Color&); 100 void drawFocusRing(const Vector<FloatRect>&, float width, float offset, const Color&); 102 101 103 102 void save(); … … 172 171 } 173 172 174 #endif // DisplayListRecorder_h -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListReplayer.h
r195515 r224312 24 24 */ 25 25 26 #ifndef DisplayListReplayer_h 27 #define DisplayListReplayer_h 26 #pragma once 28 27 29 28 #include "DisplayList.h" … … 54 53 } 55 54 56 #endif // DisplayListReplayer_h -
trunk/Source/WebCore/platform/graphics/mac/WebLayer.h
r217296 r224312 24 24 */ 25 25 26 #ifndef WebLayer_h 27 #define WebLayer_h 26 #pragma once 28 27 29 28 #include <QuartzCore/QuartzCore.h> … … 40 39 #endif 41 40 42 #endif // WebLayer_h -
trunk/Tools/ChangeLog
r224291 r224312 1 2017-11-01 Simon Fraser <simon.fraser@apple.com> 2 3 Misc display list and other cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=179150 5 6 Reviewed by Tim Horton. 7 8 Add system trace points for display list recording. 9 10 * Tracing/SystemTracePoints.plist: 11 1 12 2017-11-01 Stephan Szabo <stephan.szabo@sony.com> 2 13 -
trunk/Tools/Tracing/SystemTracePoints.plist
r215967 r224312 185 185 <dict> 186 186 <key>Name</key> 187 <string>Record display list</string> 188 <key>Type</key> 189 <string>Interval</string> 190 <key>Component</key> 191 <string>47</string> 192 <key>CodeBegin</key> 193 <string>5023</string> 194 <key>CodeEnd</key> 195 <string>5024</string> 196 </dict> 197 <dict> 198 <key>Name</key> 187 199 <string>Paint WebHTMLView</string> 188 200 <key>Type</key>
Note: See TracChangeset
for help on using the changeset viewer.