Bug 30501 - Flash at end of opacity/transform transition sometimes
: Flash at end of opacity/transform transition sometimes
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering
: 528+ (Nightly build)
: Macintosh Mac OS X 10.5
: P2 Normal
Assigned To: Simon Fraser (smfr)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-18 21:10 PDT by Simon Fraser (smfr)
Modified: 2009-10-19 17:39 PDT (History)
1 user (show)

See Also:


Attachments
Testcase (1.57 KB, text/html)
2009-10-18 21:10 PDT, Simon Fraser (smfr)
no flags Details
Proto patch (4.46 KB, patch)
2009-10-18 21:12 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (5.82 KB, patch)
2009-10-19 17:03 PDT, Simon Fraser (smfr)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2009-10-18 21:10:41 PDT
Created attachment 41393 [details]
Testcase

In some content, there's a noticeable flash sometimes when a transform or opacity transition ends sometimes. I'm having a hard time making a reduced testcase, but the attached shows it sometimes.
Comment 1 Simon Fraser (smfr) 2009-10-18 21:11:55 PDT
The flash happens because we remove the transition on the GraphicsLayer before we set the final opacity/transform style, so there's a window where it renders with the original opacity/transform.
Comment 2 Simon Fraser (smfr) 2009-10-18 21:12:38 PDT
Created attachment 41394 [details]
Proto patch
Comment 3 Chris Marrin 2009-10-19 07:38:02 PDT
Comment on attachment 41394 [details]
Proto patch

> diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
> index 4c82843..d7248d4 100644
> --- a/WebCore/rendering/RenderLayerBacking.cpp
> +++ b/WebCore/rendering/RenderLayerBacking.cpp
> @@ -89,8 +89,8 @@ void RenderLayerBacking::createGraphicsLayer()
>          m_graphicsLayer->setName("Anonymous Node");
>  #endif  // NDEBUG
>  
> -    updateLayerOpacity();
> -    updateLayerTransform();
> +    updateLayerOpacity(renderer()->style());
> +    updateLayerTransform(renderer()->style());
>  }
>  
>  void RenderLayerBacking::destroyGraphicsLayer()
> @@ -104,15 +104,13 @@ void RenderLayerBacking::destroyGraphicsLayer()
>      m_maskLayer = 0;
>  }
>  
> -void RenderLayerBacking::updateLayerOpacity()
> +void RenderLayerBacking::updateLayerOpacity(const RenderStyle* style)
>  {
> -    m_graphicsLayer->setOpacity(compositingOpacity(renderer()->opacity()));
> +    m_graphicsLayer->setOpacity(compositingOpacity(style->opacity()));
>  }

I don't see how these two are different? How is passing in renderer()->style() and setting the opacity to renderer()->style() is different?

What is the fix you're doing here?
Comment 4 Simon Fraser (smfr) 2009-10-19 07:40:07 PDT
I just pass in style there so I can use toStyle lower down. Look at the rest of the patch.
Comment 5 Simon Fraser (smfr) 2009-10-19 17:03:16 PDT
Created attachment 41462 [details]
Patch
Comment 6 Simon Fraser (smfr) 2009-10-19 17:39:59 PDT
http://trac.webkit.org/changeset/49823