SkPdfFunction SkPdfType2ShadingDictionary::Function(SkPdfNativeDoc* doc) { SkPdfNativeObject* ret = get("Function", ""); if (doc) {ret = doc->resolveReference(ret);} if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->functionValue(); // TODO(edisonn): warn about missing required field, assert for known good pdfs return SkPdfFunction(); }
SkPdfFunction SkPdfType4ShadingDictionary::Function(SkPdfNativeDoc* doc) { SkPdfNativeObject* ret = get("Function", ""); if (doc) {ret = doc->resolveReference(ret);} if ((ret != NULL && ret->isFunction()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->functionValue(); // TODO(edisonn): warn about missing default value for optional fields return SkPdfFunction(); }