• Bo Liu's avatar
    Add DCHECK for ScheduleGpuTask · 472ef62b
    Bo Liu authored
    Viz for webview architecture will only support calling ScheduleTask from
    viz thread at limited times (initialization, tear down, DrawAndSwap). In
    order to avoid violating this requirement, add a DCHECK for the existing
    ScheduleGpuTask to ensure it is only called during allowed times.
    
    Also add a ScheduleOrRetainTask method for the cases where existing
    code violates this requirement. In viz for webview, such tasks may be
    delayed indefinitely, until the next DrawAndSwap or tear down.
    There are only two cases, EnsureBackbuffer and ReleaseCachedResources,
    that violate the requirement. Convert them to ScheduleOrRetainGpuTask.
    
    Only enable the DCHECK for SkiaRenderer since that's the only case
    relevant for viz for webview.
    
    Bug: 805739
    Change-Id: Ic9ba91d85958fbe8ff0d8e30d1bc9095fd8cf62c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713871Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
    Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
    Commit-Queue: Bo <boliu@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#681860}
    472ef62b
DEPS 553 Bytes