Bug 177903

Summary: Lots of missing frames in YouTube360 when fullscreen on MacBook
Product: WebKit Reporter: Dean Jackson <dino>
Component: New BugsAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, buildbot, commit-queue, graouts, jonlee, kondapallykalyan, mmaxfield, noam, ryanhaddad, sam, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=179368
Bug Depends on: 177992    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch sam: review+

Dean Jackson
Reported 2017-10-04 16:45:44 PDT
Lots of missing frames in YouTube360 when fullscreen on MacBook
Attachments
Patch (24.05 KB, patch)
2017-10-04 17:30 PDT, Dean Jackson
no flags
Patch (23.90 KB, patch)
2017-10-05 10:23 PDT, Dean Jackson
no flags
Patch (23.92 KB, patch)
2017-10-05 10:26 PDT, Dean Jackson
sam: review+
Dean Jackson
Comment 1 2017-10-04 17:30:24 PDT
Sam Weinig
Comment 2 2017-10-04 17:35:39 PDT
Comment on attachment 322747 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322747&action=review > Source/WebCore/platform/graphics/cocoa/WebGLLayer.h:49 > + int _width; > + int _height; IntSize? > Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:75 > + [super setTransform:CATransform3DScale(t, 1., -1., 1.)]; This can be CATransform3DScale(t, 1, -1, 1)
Simon Fraser (smfr)
Comment 3 2017-10-04 18:35:18 PDT
Comment on attachment 322747 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322747&action=review > Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm:678 > + LOG(WebGL, "Tell the WebGL layer to create IOSurface backing store. (%p)", this); Would make more sense to just log the function name, size, and m_attrs.alpha. > Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm:684 > + LOG(WebGL, "Tell the WebGL layer to bind to the framebuffer. (%p)", this); Log the function name > Source/WebCore/platform/graphics/cocoa/WebGLLayer.h:47 > + std::unique_ptr<WebCore::IOSurface> _contentsBuffer; > + std::unique_ptr<WebCore::IOSurface> _drawingBuffer; > + std::unique_ptr<WebCore::IOSurface> _spareBuffer; What about frontBuffer, backBuffer and secondaryBackBuffer as we use in RemoteLayerBackingStore? >> Source/WebCore/platform/graphics/cocoa/WebGLLayer.h:49 >> + int _height; > > IntSize? Yes. > Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:59 > + self.transform = CATransform3DIdentity; Is this necessary? > Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:68 > +// means that any incoming transform (unlikely, since this Unlikely, or impossible? >> Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:75 >> + [super setTransform:CATransform3DScale(t, 1., -1., 1.)]; > > This can be CATransform3DScale(t, 1, -1, 1) Seems odd to do this as an override. Maybe the init method should just set the transform and anchor point? What happens with object-fit on a WebGL? Is the WebGLLayer itself just a content layer? > Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:149 > +static std::unique_ptr<WebCore::IOSurface> createAppropriateIOSurface(int width, int height) "Appropriate" in what sense? > Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:152 > + auto surface = WebCore::IOSurface::create(IntSize(width, height), sRGBColorSpaceRef()); > + return surface; No need for the local variable. > Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:155 > +- (void)createIOSurfaceBackingStoreWithWidth:(int)width height:(int)height usingAlpha:(BOOL)usingAlpha A function called "create" is normally expected to return a retained object. > Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:181 > +#ifndef NDEBUG This should be ASSERTIONS_ENABLED, but probably cleaner to just ASSERT_UNUSED() > Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:78 > + for (int i = 0; i < totalBytes; i += 4) > + pixels[i + 3] = 255; Seems like Accelerate might have a faster way to do this? I assume the buffers never have rowByte padding?
Jon Lee
Comment 4 2017-10-05 00:36:32 PDT
Dean Jackson
Comment 5 2017-10-05 10:20:35 PDT
Comment on attachment 322747 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=322747&action=review >> Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm:678 >> + LOG(WebGL, "Tell the WebGL layer to create IOSurface backing store. (%p)", this); > > Would make more sense to just log the function name, size, and m_attrs.alpha. Done. >> Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm:684 >> + LOG(WebGL, "Tell the WebGL layer to bind to the framebuffer. (%p)", this); > > Log the function name Done. >> Source/WebCore/platform/graphics/cocoa/WebGLLayer.h:47 >> + std::unique_ptr<WebCore::IOSurface> _spareBuffer; > > What about frontBuffer, backBuffer and secondaryBackBuffer as we use in RemoteLayerBackingStore? I like my names better, because they make more sense with respect to how they are used. WebGL is drawing into a buffer that it thinks is the front. And what does secondaryBackBuffer mean? It's really a third spare buffer. >>> Source/WebCore/platform/graphics/cocoa/WebGLLayer.h:49 >>> + int _height; >> >> IntSize? > > Yes. Changed. >> Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:59 >> + self.transform = CATransform3DIdentity; > > Is this necessary? It is, so that we call the flipping code. I could set it directly, but then it would be unflipped by the code in setTransform :) >> Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:68 >> +// means that any incoming transform (unlikely, since this > > Unlikely, or impossible? Impossible. >>> Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:75 >>> + [super setTransform:CATransform3DScale(t, 1., -1., 1.)]; >> >> This can be CATransform3DScale(t, 1, -1, 1) > > Seems odd to do this as an override. Maybe the init method should just set the transform and anchor point? > > What happens with object-fit on a WebGL? Is the WebGLLayer itself just a content layer? It can't be just the init method, since GraphicsLayerCA::setupContentsLayer comes along and sets an anchor point (and maybe a transform) after creation. I thought it would be better to specialize here rather than in the higher-level code. >> Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:149 >> +static std::unique_ptr<WebCore::IOSurface> createAppropriateIOSurface(int width, int height) > > "Appropriate" in what sense? I removed this method. >> Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:155 >> +- (void)createIOSurfaceBackingStoreWithWidth:(int)width height:(int)height usingAlpha:(BOOL)usingAlpha > > A function called "create" is normally expected to return a retained object. Renamed to allocate. >> Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:181 >> +#ifndef NDEBUG > > This should be ASSERTIONS_ENABLED, but probably cleaner to just ASSERT_UNUSED() FIxed.
Dean Jackson
Comment 6 2017-10-05 10:23:17 PDT
Dean Jackson
Comment 7 2017-10-05 10:26:06 PDT
Dean Jackson
Comment 8 2017-10-05 19:31:52 PDT
Ryan Haddad
Comment 9 2017-10-05 21:39:12 PDT
(In reply to Dean Jackson from comment #8) > Committed r222951: <http://trac.webkit.org/changeset/222951> This change failed to build on iOS EWS before it was landed. It broke the build: https://build.webkit.org/builders/Apple%20iOS%2011%20Release%20%28Build%29/builds/529
Ryan Haddad
Comment 11 2017-10-05 21:58:28 PDT
I see there was an iOS build fix in http://trac.webkit.org/changeset/222952, but the build is still failing: https://build.webkit.org/builders/Apple%20iOS%2011%20Simulator%20Release%20%28Build%29/builds/481 It looks like another function is outside the #if PLATFORM(MAC) block, so it should be easy to fix. Still, I am going to roll out due to the build breakage and LayoutTest regression.
WebKit Commit Bot
Comment 12 2017-10-05 21:59:16 PDT
Re-opened since this is blocked by bug 177992
Dean Jackson
Comment 13 2017-10-05 23:37:33 PDT
Note You need to log in before you can comment on or make changes to this bug.