diff options
author | Yuqian Li <liyuqian@google.com> | 2018-05-04 14:19:56 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-04 19:23:13 +0000 |
commit | b9a1e688fd9c3e64c50d9159481e72a812f978c1 (patch) | |
tree | 42da8b35d7a8d44519ee28b6382147488bcb4a7b /src/core/SkBitmapDevice.h | |
parent | e99a4b1099f70f33c310497df25e8ed849b056d9 (diff) |
Respect SkBitmapDeviceFilteredSurfaceProps in SkThreadedBMPDevice
Bug: skia:7909
Change-Id: I3e480a57f16eec97706296137c8c1061555b9701
Reviewed-on: https://skia-review.googlesource.com/126100
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src/core/SkBitmapDevice.h')
-rw-r--r-- | src/core/SkBitmapDevice.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/SkBitmapDevice.h b/src/core/SkBitmapDevice.h index f80cba6ee4..62b1063ba4 100644 --- a/src/core/SkBitmapDevice.h +++ b/src/core/SkBitmapDevice.h @@ -179,4 +179,20 @@ private: typedef SkBaseDevice INHERITED; }; +class SkBitmapDeviceFilteredSurfaceProps { +public: + SkBitmapDeviceFilteredSurfaceProps(const SkBitmap& bitmap, const SkPaint& paint, + const SkSurfaceProps& surfaceProps) + : fSurfaceProps((kN32_SkColorType != bitmap.colorType() || !paint.isSrcOver()) + ? fLazy.init(surfaceProps.flags(), kUnknown_SkPixelGeometry) + : &surfaceProps) + { } + + const SkSurfaceProps& operator()() const { return *fSurfaceProps; } + +private: + SkTLazy<SkSurfaceProps> fLazy; + SkSurfaceProps const * const fSurfaceProps; +}; + #endif // SkBitmapDevice_DEFINED |