Reland "Add SkNoDestructor<T> class to Skia."
This reverts commit d85e872b336fa12f2f66d003f49ff34f09b26c5b.
Reason for revert: adding #include
Original change's description:
> Revert "Add SkNoDestructor<T> class to Skia."
>
> This reverts commit 485cd3d0f9ca5524458c168b8d31c64c6348655e.
>
> Reason for revert: Appears to be breaking G3 roll
>
> Original change's description:
> > Add SkNoDestructor<T> class to Skia.
> >
> > This class is adapted from Chromium, and is BSD-licensed:
> > https://crsrc.org/c/base/no_destructor.h
> >
> > `static SkNoDestructor<T> foo(...);` inside a function approximates
> > a global singleton, but is safe from ordering concerns at startup or
> > shutdown. It is also faster than allocating an object on the heap.
> > (We used to consider allocation from the heap as a sufficiently-
> > good solution, but apparently this leads to measurable overhead
> > when everyone does it:
> > http://go/totw/110#the-fix-safe-initialization-no-destruction)
> >
> > I've added it to SkSL in places where we currently allocate.
> >
> > Change-Id: I2f1c6cf915c6f1294242951206a9d40e640fa4cc
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/694624
> > Reviewed-by: Kevin Lubick <kjlubick@google.com>
> > Reviewed-by: Herb Derby <herb@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
>
> Change-Id: If8b83ab687ae980eee018beca52d4715da91a186
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/695236
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Brian Osman <brianosman@google.com>
Change-Id: I08610f0b69556fb561a49ffe0f0c3c726cbf294a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/695239
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
8 files changed