• ccameron@chromium.org's avatar
    Fix crash in GotAcceleratedIOSurfaceFrame · 35b177f4
    ccameron@chromium.org authored
    The root cause here is that it was assumed that creation of a
    CompositingIOSurfaceMac and CompositingIOSurfaceContext
    cannot not fail when, in fact, it can. This resulted in a NULL
    reference later on.
    
    Fix part of this by making CompositingIOSurfaceLayer's init function
    fail if the CompositingIOSurfaceContext fails.
    
    Fix the remaining part of this by removing the NULL references from
    BrowserCompositorViewMacInternal::GotAcceleratedIOSurfaceFrame,
    and make the function call AcceleratedLayerHitError if any errors are
    encountered, which will cause the layer to re-attempt the frame with
    a new context.
    
    Also, split AcceleratedLayerDidDrawFrame into two functions,
    AcceleratedLayerDidDrawFrame and AcceleratedLayerHitError, rather
    than parameterizing success using a bool, since that naming was
    deceptive.
    
    BUG=401630
    
    Review URL: https://codereview.chromium.org/447113004
    
    Cr-Commit-Position: refs/heads/master@{#288328}
    git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288328 0039d316-1c4b-4281-b951-d872f2087c98
    35b177f4
compositing_iosurface_layer_mac.h 5.39 KB