Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5772)

Unified Diff: bench/PDFBench.cpp

Issue 1829693002: SkPDF: draw{Image,Bitmap} always serializes early (Closed) Base URL: https://skia.googlesource.com/skia.git@r1823683005
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gyp/pdf.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PDFBench.cpp
diff --git a/bench/PDFBench.cpp b/bench/PDFBench.cpp
index 076f175b7290c38c6899ddfaa882cc81b2a7b4aa..9da745c2806f2ad7586689f052d6d542f23ec160 100644
--- a/bench/PDFBench.cpp
+++ b/bench/PDFBench.cpp
@@ -26,12 +26,12 @@ struct NullWStream : public SkWStream {
size_t fN;
};
-static void test_pdf_object_serialization(SkPDFObject* object) {
+static void test_pdf_object_serialization(const sk_sp<SkPDFObject> object) {
// SkDebugWStream wStream;
NullWStream wStream;
SkPDFSubstituteMap substitutes;
SkPDFObjNumMap objNumMap;
- objNumMap.addObjectRecursively(object, substitutes);
+ objNumMap.addObjectRecursively(object.get(), substitutes);
for (int i = 0; i < objNumMap.objects().count(); ++i) {
SkPDFObject* object = objNumMap.objects()[i].get();
wStream.writeDecAsText(i + 1);
@@ -67,8 +67,7 @@ protected:
return;
}
while (loops-- > 0) {
- SkAutoTUnref<SkPDFObject> object(
- SkPDFCreateBitmapObject(fImage.get(), nullptr));
+ auto object = SkPDFCreateBitmapObject(fImage, nullptr);
SkASSERT(object);
if (!object) {
return;
@@ -94,7 +93,7 @@ protected:
void onDelayedSetup() override {
sk_sp<SkImage> img(GetResourceAsImage("mandrill_512_q075.jpg"));
if (!img) { return; }
- SkAutoTUnref<SkData> encoded(img->refEncoded());
+ sk_sp<SkData> encoded(img->refEncoded());
SkASSERT(encoded);
if (!encoded) { return; }
fImage = img;
@@ -105,8 +104,7 @@ protected:
return;
}
while (loops-- > 0) {
- SkAutoTUnref<SkPDFObject> object(
- SkPDFCreateBitmapObject(fImage.get(), nullptr));
+ auto object = SkPDFCreateBitmapObject(fImage, nullptr);
SkASSERT(object);
if (!object) {
return;
@@ -138,7 +136,7 @@ protected:
SkASSERT(fAsset);
if (!fAsset) { return; }
while (loops-- > 0) {
- SkAutoTUnref<SkPDFObject> object(
+ sk_sp<SkPDFObject> object(
new SkPDFSharedStream(fAsset->duplicate()));
test_pdf_object_serialization(object);
}
« no previous file with comments | « no previous file | gyp/pdf.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698