1 /*
2  * Copyright 2017 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkImageFilterPriv_DEFINED
9 #define SkImageFilterPriv_DEFINED
10 
11 #include "SkImageFilter.h"
12 
13 /**
14  *  Helper to unflatten the common data, and return nullptr if we fail.
15  */
16 #define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount)    \
17     Common localVar;                                                \
18     do {                                                            \
19         if (!localVar.unflatten(buffer, expectedCount)) {           \
20             return nullptr;                                         \
21         }                                                           \
22     } while (0)
23 
24 #endif
25