aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2018-05-04 17:54:39 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-04 23:26:13 +0000
commit3d5b83bf95333a0b31b08fb4a889fa7697c87c03 (patch)
tree3e6f2fe83470d535797d4202dae44ee5fbd9be2e /src/core
parentfb799af68b0b691fe53adc0459f96434c32d3a9d (diff)
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 <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src/core')
-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