aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapDevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkBitmapDevice.h')
-rw-r--r--src/core/SkBitmapDevice.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core/SkBitmapDevice.h b/src/core/SkBitmapDevice.h
index 62b1063ba4..dd8be7f277 100644
--- a/src/core/SkBitmapDevice.h
+++ b/src/core/SkBitmapDevice.h
@@ -182,17 +182,20 @@ private:
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& surfaceProps) {
+ if (kN32_SkColorType != bitmap.colorType() || !paint.isSrcOver()) {
+ SkSurfaceProps* newProps = fLazy.init(surfaceProps.flags(), kUnknown_SkPixelGeometry);
+ fSurfaceProps = newProps;
+ } else {
+ fSurfaceProps = &surfaceProps;
+ }
+ }
const SkSurfaceProps& operator()() const { return *fSurfaceProps; }
private:
+ const SkSurfaceProps* fSurfaceProps;
SkTLazy<SkSurfaceProps> fLazy;
- SkSurfaceProps const * const fSurfaceProps;
};
#endif // SkBitmapDevice_DEFINED