Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
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;
}