Changeset 260547 in webkit
- Timestamp:
- Apr 22, 2020 5:42:45 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r260535 r260547 1 2020-04-22 Daniel Bates <dabates@apple.com> 2 3 Support toggling debug overlay for touch action region and editable element region independent from non-fast scrollable region 4 https://bugs.webkit.org/show_bug.cgi?id=210774 5 6 Reviewed by Dean Jackson. 7 8 Break out the touch action region and editable element region debug overlays into their own 9 flags that can be passed to Settings::setVisibleDebugOverlayRegions() to toggle these overlays, 10 respectively. Currently both of these overlays piggyback on whether the engine will paint the 11 non-fast scrollable region. 12 13 * page/SettingsBase.h: Add two more enumerators. 14 * rendering/RenderLayer.cpp: 15 (WebCore::RenderLayer::invalidateEventRegion const): Update the code to be more precise now that 16 we can target the update paint overlay hack to when we are painting touch-action or editable 17 element regions. 18 * rendering/RenderLayerBacking.cpp: 19 (WebCore::RenderLayerBacking::paintDebugOverlays): Condition the painting of touch action region 20 on one enumerator and the painting of editable element region on another. 21 (WebCore::RenderLayerBacking::paintContents): Update the code to be more precise. 22 1 23 2020-04-22 Chris Dumez <cdumez@apple.com> 2 24 -
trunk/Source/WebCore/page/SettingsBase.h
r257862 r260547 70 70 NonFastScrollableRegion = 1 << 0, 71 71 WheelEventHandlerRegion = 1 << 1, 72 TouchActionRegion = 1 << 2, 73 EditableElementRegion = 1 << 3, 72 74 }; 73 75 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r260445 r260547 7023 7023 auto& view = renderer().view(); 7024 7024 view.setNeedsEventRegionUpdateForNonCompositedFrame(); 7025 if (renderer().settings().visibleDebugOverlayRegions() & NonFastScrollableRegion)7025 if (renderer().settings().visibleDebugOverlayRegions() & (TouchActionRegion | EditableElementRegion)) 7026 7026 view.setNeedsRepaintHackAfterCompositingLayerUpdateForDebugOverlaysOnly(); 7027 7027 view.compositor().scheduleCompositingLayerUpdate(); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r260482 r260547 3110 3110 void RenderLayerBacking::paintDebugOverlays(const GraphicsLayer* graphicsLayer, GraphicsContext& context) 3111 3111 { 3112 if (graphicsLayer->eventRegion().isEmpty()) 3112 auto& eventRegion = graphicsLayer->eventRegion(); 3113 if (eventRegion.isEmpty()) 3113 3114 return; 3114 3115 … … 3119 3120 context.translate(-contentOffset); 3120 3121 3122 auto visibleDebugOverlayRegions = renderer().settings().visibleDebugOverlayRegions(); 3123 3121 3124 // The interactive part. 3122 3125 // Paint rects for touch action. 3123 auto& eventRegion = graphicsLayer->eventRegion(); 3124 Color regionColor(0, 0, 255, 50); 3125 context.setFillColor(regionColor); 3126 for (auto rect : eventRegion.region().rects()) 3127 context.fillRect(rect); 3128 3129 const TouchAction touchActionList[] = { 3130 TouchAction::None, 3131 TouchAction::Manipulation, 3132 TouchAction::PanX, 3133 TouchAction::PanY, 3134 TouchAction::PinchZoom, 3135 }; 3136 3137 for (auto action : touchActionList) { 3138 auto* actionRegion = graphicsLayer->eventRegion().regionForTouchAction(action); 3139 if (!actionRegion) 3140 continue; 3141 3142 auto fillPattern = patternForTouchAction(action, contentOffsetInCompositingLayer(), context); 3143 if (!fillPattern) 3144 continue; 3145 3146 context.setFillPattern(fillPattern.releaseNonNull()); 3147 for (auto rect : actionRegion->rects()) 3126 if (visibleDebugOverlayRegions & TouchActionRegion) { 3127 Color regionColor(0, 0, 255, 50); 3128 context.setFillColor(regionColor); 3129 for (auto rect : eventRegion.region().rects()) 3148 3130 context.fillRect(rect); 3131 3132 const TouchAction touchActionList[] = { 3133 TouchAction::None, 3134 TouchAction::Manipulation, 3135 TouchAction::PanX, 3136 TouchAction::PanY, 3137 TouchAction::PinchZoom, 3138 }; 3139 3140 for (auto action : touchActionList) { 3141 auto* actionRegion = graphicsLayer->eventRegion().regionForTouchAction(action); 3142 if (!actionRegion) 3143 continue; 3144 3145 auto fillPattern = patternForTouchAction(action, contentOffsetInCompositingLayer(), context); 3146 if (!fillPattern) 3147 continue; 3148 3149 context.setFillPattern(fillPattern.releaseNonNull()); 3150 for (auto rect : actionRegion->rects()) 3151 context.fillRect(rect); 3152 } 3149 3153 } 3150 3154 3151 3155 #if ENABLE(EDITABLE_REGION) 3152 3156 // Paint rects for editable elements. 3153 context.setFillColor({ 128, 0, 128, 50 }); 3154 for (auto rect : eventRegion.rectsForEditableElements()) 3155 context.fillRect(rect); 3157 if (visibleDebugOverlayRegions & EditableElementRegion) { 3158 context.setFillColor({ 128, 0, 128, 50 }); 3159 for (auto rect : eventRegion.rectsForEditableElements()) 3160 context.fillRect(rect); 3161 } 3156 3162 #endif 3157 3163 } … … 3196 3202 paintIntoLayer(graphicsLayer, context, dirtyRect, behavior); 3197 3203 3198 if (renderer().settings().visibleDebugOverlayRegions() & NonFastScrollableRegion) // Piggy-back off the setting that shows touch handler regions.3204 if (renderer().settings().visibleDebugOverlayRegions() & (TouchActionRegion | EditableElementRegion)) 3199 3205 paintDebugOverlays(graphicsLayer, context); 3200 3206 -
trunk/Source/WebKit/ChangeLog
r260546 r260547 1 2020-04-22 Daniel Bates <dabates@apple.com> 2 3 Support toggling debug overlay for touch action region and editable element region independent from non-fast scrollable region 4 https://bugs.webkit.org/show_bug.cgi?id=210774 5 6 Reviewed by Dean Jackson. 7 8 Expose two new enumerators to toggle touch action region and editable element region 9 overlay painting. 10 11 * UIProcess/API/C/WKPreferencesRef.h: 12 * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 13 1 14 2020-04-22 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRef.h
r254397 r260547 47 47 enum WKDebugOverlayRegionFlags { 48 48 kWKNonFastScrollableRegion = 1 << 0, 49 kWKWheelEventHandlerRegion = 1 << 1 49 kWKWheelEventHandlerRegion = 1 << 1, 50 kWKTouchActionRegion = 1 << 2, 51 kWKEditableElementRegion = 1 << 3, 50 52 }; 51 53 typedef unsigned WKDebugOverlayRegions; -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
r260334 r260547 35 35 typedef NS_OPTIONS(NSUInteger, _WKDebugOverlayRegions) { 36 36 _WKNonFastScrollableRegion = 1 << 0, 37 _WKWheelEventHandlerRegion = 1 << 1 37 _WKWheelEventHandlerRegion = 1 << 1, 38 _WKTouchActionRegion = 1 << 2, 39 _WKEditableElementRegion = 1 << 3, 38 40 } WK_API_AVAILABLE(macos(10.11), ios(9.0)); 39 41
Note: See TracChangeset
for help on using the changeset viewer.