diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkBitmapDevice.h | 15 |
1 files 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<SkSurfaceProps> fLazy; + SkSurfaceProps const * const fSurfaceProps; }; #endif // SkBitmapDevice_DEFINED |