Skip to content
  • timothy_horton@apple.com's avatar
    Remote Layer Tree: RemoteLayerBackingStore partial repaint is broken for the tile cache · c016bd71
    timothy_horton@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=123944
    
    Reviewed by Simon Fraser.
    
    Ensure that the tile cache retrieves repaint rects from the tile layer,
    not from the tiled backing layer.
    
    Rework RemoteLayerBackingStore painting to fix some rounding issues
    that would cause pixel cracks upon repaint, and to speed it up a bit.
    
    * Shared/mac/RemoteLayerBackingStore.h:
    Redefine RepaintRectList because we can't include WebLayer.h here yet.
    Remove createBackingStore, which was never implemented.
    Remove mapToContentCoordinates, because we don't need it on Mac.
    
    (WebKit::RemoteLayerBackingStore::paintingRects): Added.
    
    * Shared/mac/RemoteLayerBackingStore.mm:
    (RemoteLayerBackingStore::setNeedsDisplay):
    (RemoteLayerBackingStore::display):
    Stop using mapToContentCoordinates.
    
    (RemoteLayerBackingStore::drawInContext):
    Use clipping instead of painting the image multiple times.
    Never repaint more than the dirty region's bounds.
    Don't waste time with all of the drawNativeImage code, just use CG.
    Unindent the switch's cases.
    Store the rects we're painting so that enumerateRectsBeingDrawn can get them.
    Pixel-snap the rects we're painting.
    Clip the context before going to paint.
    
    * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
    (PlatformCALayerRemote::enumerateRectsBeingDrawn):
    * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
    Retrieve the rects currently being painted from our backing store, and
    transform them (mostly) according to the CTM, to match the transformation
    that will have occurred underneath wkCALayerEnumerateRectsBeingDrawnWithBlock.
    
    * platform/graphics/ca/PlatformCALayer.h:
    * platform/graphics/ca/mac/PlatformCALayerMac.h:
    * platform/graphics/ca/mac/PlatformCALayerMac.mm:
    (PlatformCALayerMac::enumerateRectsBeingDrawn):
    Allow the PlatformCALayer to decide how to enumerate rects to paint.
    
    * WebCore.exp.in:
    * platform/graphics/mac/WebLayer.h:
    Add RepaintRectList, remove some unnecessary WebCore::s.
    
    * platform/graphics/mac/WebLayer.mm:
    (WebCore::collectRectsToPaint):
    Factor collectRectsToPaint out; it just grabs the rects from
    the layer and makes the decision whether to repaint the bounds
    of the dirty region or just the subregions.
    
    Move calls to collectRectsToPaint() to callers of drawLayerContents(),
    so that TileController can collect rects from the appropriate source
    (the Tile layer) and other layers just continue grabbing them from
    their relevant layers.
    
    Make sure that the list that comes from collectRectsToPaint() always
    has at least one rect in it (appending the clip bounds if we don't
    want to repaint subregions) so we can simplify logic in drawLayerContents.
    
    (WebCore::drawLayerContents):
    Remove code to support CompositingCoordinatesBottomUp, as it's only
    used on Windows, so this Mac-specific code doesn't need to support it.
    
    Simplify logic given that dirtyRects will always be non-empty.
    
    (-[WebLayer drawInContext:]):
    (-[WebSimpleLayer setNeedsDisplayInRect:]):
    * platform/graphics/ca/mac/TileController.mm:
    (WebCore::TileController::platformCALayerPaintContents):
    Adopt collectRectsToPaint.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    c016bd71