SkRect SkPdfBlockLevelStructureElementsDictionary::BBox(SkPdfNativeDoc* doc) { SkPdfNativeObject* ret = get("BBox", ""); if (doc) {ret = doc->resolveReference(ret);} if ((ret != NULL && ret->isRectangle()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->rectangleValue(); // TODO(edisonn): warn about missing default value for optional fields return SkRect::MakeEmpty(); }
SkRect SkPdfType4ShadingDictionary::Decode(SkPdfNativeDoc* doc) { SkPdfNativeObject* ret = get("Decode", ""); if (doc) {ret = doc->resolveReference(ret);} if ((ret != NULL && ret->isRectangle()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->rectangleValue(); // TODO(edisonn): warn about missing required field, assert for known good pdfs return SkRect::MakeEmpty(); }