diff options
Diffstat (limited to 'src/core/SkXfermode.cpp')
-rw-r--r-- | src/core/SkXfermode.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp index 8773c400d4..e4d34e1ada 100644 --- a/src/core/SkXfermode.cpp +++ b/src/core/SkXfermode.cpp @@ -692,11 +692,18 @@ void SkProcXfermode::xferA8(SkAlpha* SK_RESTRICT dst, SkProcXfermode::SkProcXfermode(SkFlattenableReadBuffer& buffer) : SkXfermode(buffer) { + // Might be a NULL if the Xfermode is recorded using the CrossProcess flag fProc = (SkXfermodeProc)buffer.readFunctionPtr(); } void SkProcXfermode::flatten(SkFlattenableWriteBuffer& buffer) { - buffer.writeFunctionPtr((void*)fProc); + if (buffer.isCrossProcess()) { + // function pointer is only valid in the current process. Write a NULL + // so it can't be accidentally used + buffer.writeFunctionPtr(NULL); + } else { + buffer.writeFunctionPtr((void*)fProc); + } } /////////////////////////////////////////////////////////////////////////////// |