diff options
author | yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-10 18:34:50 +0000 |
---|---|---|
committer | yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-10 18:34:50 +0000 |
commit | f468e47ba5bf254a93ba5d1a81f9fbead7f11bd5 (patch) | |
tree | 06ccc8784cfb337f8dbd435bed7bd7b4a87f6ba3 /src | |
parent | 5ed23dee375cb1b356aba8ae5a010f8e872b31bf (diff) |
Write null for any function pointers when using the cross process flag
git-svn-id: http://skia.googlecode.com/svn/trunk@2096 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-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); + } } /////////////////////////////////////////////////////////////////////////////// |