Bug 162704 - [Coordinated Graphics] Debug Visuals don't hide
Summary: [Coordinated Graphics] Debug Visuals don't hide
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-28 15:59 PDT by Yoshiaki Jitsukawa
Modified: 2017-05-09 05:38 PDT (History)
8 users (show)

See Also:


Attachments
Patch (13.73 KB, patch)
2016-09-28 16:59 PDT, Yoshiaki Jitsukawa
no flags Details | Formatted Diff | Diff
Patch (14.44 KB, patch)
2017-05-09 00:04 PDT, Yoshiaki Jitsukawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yoshiaki Jitsukawa 2016-09-28 15:59:57 PDT
In the EFL mini browser, the debug visuals (borders and repaint counters) show when the "show compositing borders" button on the inspector is pressed. However the visuals don't hide when the button is pressed again.
Comment 1 Yoshiaki Jitsukawa 2016-09-28 16:59:27 PDT
Created attachment 290144 [details]
Patch
Comment 2 Gwang Yoon Hwang 2017-05-03 09:04:45 PDT
Comment on attachment 290144 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=290144&action=review

> Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:478
> +    m_layerState.debugVisuals.showDebugBorders = show;

Nice finding! But I think it is enough to remove this line:
m_layerState.showDebugBorders = true;

Because CoordinatedGraphicsLayer::syncLayerState will set the proper value to the m_layerState.showDebugBorder

> Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:490
> +    m_layerState.debugVisuals.showRepaintCounter = show;

Same here.

> Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:79
> +    float debugBorderWidth;

Nowadays, we initialize members like this:
float debugBorderWidth { 0 };

> Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:87
> +};

BTW, do you have any other reason to make a new structure for debug visual?
Even in current implementation, we sent these changes to the compositing thread with a single commit.
Comment 3 Yoshiaki Jitsukawa 2017-05-07 16:06:23 PDT
(In reply to Gwang Yoon Hwang from comment #2)
> Comment on attachment 290144 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=290144&action=review
> 
> > Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:478
> > +    m_layerState.debugVisuals.showDebugBorders = show;
> 
> Nice finding! But I think it is enough to remove this line:
> m_layerState.showDebugBorders = true;
> 
> Because CoordinatedGraphicsLayer::syncLayerState will set the proper value
> to the m_layerState.showDebugBorder
> 

Thanks for reviewing. Yes, actually the minimum fix is like:

-    m_layerState.showDebugBorders = true;
+    m_layerState.debugBorderColorChanged = true; // This forces the debug visuals update

Without setting the debugBorderColorChanged flag the debug visuals are not updated because the code to change the visuals refers to only the "debugBorderColorChanged" and "debugBorderWidthChanged" flags

   if (layerState.debugBorderColorChanged || layerState.debugBorderWidthChanged)
	        layer->setDebugVisuals(layerState.showDebugBorders, layerState.debugBorderColor, layerState.debugBorderWidth, layerState.showRepaintCounter);


> BTW, do you have any other reason to make a new structure for debug visual?
> Even in current implementation, we sent these changes to the compositing
> thread with a single commit.

So, at least, with the current implementation, we need to add two update flags for the "showDebugBorders" and "showRepaintCounter" state. But instead, I made a new structure for debug visuals and an update flag for it.
Comment 4 Michael Catanzaro 2017-05-07 16:08:36 PDT
Yoon, what do you think?
Comment 5 Gwang Yoon Hwang 2017-05-08 00:57:47 PDT
(In reply to Yoshiaki Jitsukawa from comment #3)
> (In reply to Gwang Yoon Hwang from comment #2)
> > Comment on attachment 290144 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=290144&action=review
> > 
> 
> Without setting the debugBorderColorChanged flag the debug visuals are not
> updated because the code to change the visuals refers to only the
> "debugBorderColorChanged" and "debugBorderWidthChanged" flags
> 
Oh, nice. Than I agree with your change.
If you update the initialize code, I like the patch. :)
Comment 6 Yoshiaki Jitsukawa 2017-05-09 00:04:10 PDT
Created attachment 309477 [details]
Patch
Comment 7 Yoshiaki Jitsukawa 2017-05-09 00:07:39 PDT
(In reply to Gwang Yoon Hwang from comment #5)
> Oh, nice. Than I agree with your change.
> If you update the initialize code, I like the patch. :)

Thank you! The init code updated.
Comment 8 WebKit Commit Bot 2017-05-09 05:38:46 PDT
Comment on attachment 309477 [details]
Patch

Clearing flags on attachment: 309477

Committed r216502: <http://trac.webkit.org/changeset/216502>
Comment 9 WebKit Commit Bot 2017-05-09 05:38:48 PDT
All reviewed patches have been landed.  Closing bug.