From 963d1ef8acad6861e1408bd60395a644f066c5be Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Sun, 6 May 2018 13:45:43 +0000 Subject: [PATCH] Revert "Restore old SkBitmapDeviceFilteredSurfaceProps" This reverts commit 3d5b83bf95333a0b31b08fb4a889fa7697c87c03. Reason for revert: Need to revert to revert previous change Original change's description: > Restore old SkBitmapDeviceFilteredSurfaceProps > > The old seemingly unnecessary assignment is needed, otherwise > skbug.com/7909 won't be fixed, and we will also introduce some > unexpected gold changes. > > Ben: did you remember why you originally have that additional > assignment? Probably related with SkTLazy? > > Bug: skia:7909 > TBR: bungeman@google.com > Change-Id: I20293b76bb448733d3ab4a90d40282b1420000d0 > Reviewed-on: https://skia-review.googlesource.com/126204 > Reviewed-by: Yuqian Li > Commit-Queue: Yuqian Li TBR=bungeman@google.com,liyuqian@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:7909 Change-Id: I27841ba2040ad026e67402e3b11a2b0ba5a55cb9 Reviewed-on: https://skia-review.googlesource.com/126321 Reviewed-by: Greg Daniel Commit-Queue: Greg Daniel --- src/core/SkBitmapDevice.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/core/SkBitmapDevice.h b/src/core/SkBitmapDevice.h index dd8be7f277..62b1063ba4 100644 --- a/src/core/SkBitmapDevice.h +++ b/src/core/SkBitmapDevice.h @@ -182,20 +182,17 @@ private: class SkBitmapDeviceFilteredSurfaceProps { public: SkBitmapDeviceFilteredSurfaceProps(const SkBitmap& bitmap, const SkPaint& paint, - const SkSurfaceProps& surfaceProps) { - if (kN32_SkColorType != bitmap.colorType() || !paint.isSrcOver()) { - SkSurfaceProps* newProps = fLazy.init(surfaceProps.flags(), kUnknown_SkPixelGeometry); - fSurfaceProps = newProps; - } else { - fSurfaceProps = &surfaceProps; - } - } + const SkSurfaceProps& surfaceProps) + : fSurfaceProps((kN32_SkColorType != bitmap.colorType() || !paint.isSrcOver()) + ? fLazy.init(surfaceProps.flags(), kUnknown_SkPixelGeometry) + : &surfaceProps) + { } const SkSurfaceProps& operator()() const { return *fSurfaceProps; } private: - const SkSurfaceProps* fSurfaceProps; SkTLazy fLazy; + SkSurfaceProps const * const fSurfaceProps; }; #endif // SkBitmapDevice_DEFINED