diff options
author | Mike Reed <reed@google.com> | 2018-04-25 13:04:05 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-25 17:34:27 +0000 |
commit | 910ca0fd014ad9263e54e0cfa4199768b6c7fade (patch) | |
tree | 4e8556bb2e6f27868dbc32e173c682ce8dc91e42 /src/core/SkBitmapDevice.h | |
parent | f0db23633f754cc3888494ea8d37e5dd8d495bfd (diff) |
Experiment to track coverage in a layer
Bug: skia:
Change-Id: I5ed334f63e64991944394dc8103092a2c6280546
Reviewed-on: https://skia-review.googlesource.com/122000
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/core/SkBitmapDevice.h')
-rw-r--r-- | src/core/SkBitmapDevice.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/SkBitmapDevice.h b/src/core/SkBitmapDevice.h index e040b6b0c6..f80cba6ee4 100644 --- a/src/core/SkBitmapDevice.h +++ b/src/core/SkBitmapDevice.h @@ -55,10 +55,19 @@ public: * any drawing to this device will have no effect. */ SkBitmapDevice(const SkBitmap& bitmap, const SkSurfaceProps& surfaceProps, - void* externalHandle = nullptr); + void* externalHandle, const SkBitmap* coverage); static SkBitmapDevice* Create(const SkImageInfo&, const SkSurfaceProps&, - SkRasterHandleAllocator* = nullptr); + bool trackCoverage, + SkRasterHandleAllocator*); + + static SkBitmapDevice* Create(const SkImageInfo& info, const SkSurfaceProps& props) { + return Create(info, props, false, nullptr); + } + + const SkPixmap* accessCoverage() const { + return fCoverage ? &fCoverage->pixmap() : nullptr; + } protected: void* getRasterHandle() const override { return fRasterHandle; } @@ -165,6 +174,7 @@ private: SkBitmap fBitmap; void* fRasterHandle = nullptr; SkRasterClipStack fRCStack; + std::unique_ptr<SkBitmap> fCoverage; // if non-null, will have the same dimensions as fBitmap typedef SkBaseDevice INHERITED; }; |