[webkit-reviews] review granted: [Bug 132786] Triple-buffer RemoteLayerBackingStore : [Attachment 231275] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 12 16:01:55 PDT 2014


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Tim Horton
<thorton at apple.com>'s request for review:
Bug 132786: Triple-buffer RemoteLayerBackingStore
https://bugs.webkit.org/show_bug.cgi?id=132786

Attachment 231275: patch
https://bugs.webkit.org/attachment.cgi?id=231275&action=review

------- Additional Comments from Simon Fraser (smfr) <simon.fraser at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=231275&action=review


> Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm:403
> +    if (type == BufferType::Front && m_frontBuffer.surface &&
m_frontBuffer.isVolatile != isVolatile) {
> +	   if (!isVolatile || !m_frontBuffer.surface->isInUse()) {
> +	       IOSurface::SurfaceState previousState =
m_frontBuffer.surface->setIsVolatile(isVolatile);
> +	       m_frontBuffer.isVolatile = isVolatile;
> +
> +	       // Becoming non-volatile and the front buffer was purged, so we
need to repaint.
> +	       if (!isVolatile && (previousState ==
IOSurface::SurfaceState::Empty))
> +		   setNeedsDisplay();
> +	   } else
> +	       return false;
> +    } else if (type == BufferType::Back && m_backBuffer.surface &&
m_backBuffer.isVolatile != isVolatile) {
> +	   if (!isVolatile || !m_backBuffer.surface->isInUse()) {
> +	       m_backBuffer.surface->setIsVolatile(isVolatile);
> +	       m_backBuffer.isVolatile = isVolatile;
> +	   } else
> +	       return false;
> +    } else if (type == BufferType::SecondaryBack &&
m_secondaryBackBuffer.surface && m_secondaryBackBuffer.isVolatile !=
isVolatile) {
> +	   if (!isVolatile || !m_secondaryBackBuffer.surface->isInUse()) {
> +	       m_secondaryBackBuffer.surface->setIsVolatile(isVolatile);
> +	       m_secondaryBackBuffer.isVolatile = isVolatile;
> +	   } else
> +	       return false;

This logic is pretty confusing. Can you convert this to a switch(type)?


More information about the webkit-reviews mailing list