SkPDFStream* SkPDFFunctionShader::makePSFunction(const SkString& psCode, SkPDFArray* domain) { SkAutoDataUnref funcData(SkData::NewWithCopy(psCode.c_str(), psCode.size())); SkPDFStream* result = new SkPDFStream(funcData.get()); result->insertInt("FunctionType", 4); result->insert("Domain", domain); result->insert("Range", RangeObject()); return result; }
static SkPDFStream* make_ps_function(const SkString& psCode, SkPDFArray* domain) { SkAutoDataUnref funcData( SkData::NewWithCopy(psCode.c_str(), psCode.size())); SkPDFStream* result = SkNEW_ARGS(SkPDFStream, (funcData.get())); result->insertInt("FunctionType", 4); result->insert("Domain", domain); result->insert("Range", rangeObject.get()); return result; }