Mac: Enable partial swap

This is pretty trivial when using the overlay path. Just create a
new layer for the damage. The partial damage layer can be created,
removed, or resized with basically no cost, because its backing is the
already-existing IOSurface.

As each partial swap comes in, union the existing overlay layer's
rect with the rect of the new partial swap. If this grows "too big",
then do a full swap (which clears the accumulated union). The
constants here are pretty arbitrary.

BUG=474299

Review URL: https://codereview.chromium.org/1271123002

Cr-Commit-Position: refs/heads/master@{#342771}


CrOS-Libchrome-Original-Commit: aae371ca10e047d9b192acf869f8ff9601d3cdf7
2 files changed
tree: 361052ff9fafc035fac97fde0c63551b3cc3680b
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/