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

Unified Diff: tests/PDFPrimitivesTest.cpp

Issue 25054002: Use SkPicture::ExtractBitmap callback in pdf too. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix return on another funtion with signature change Created 7 years, 3 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 | « src/pdf/SkPDFImage.cpp ('k') | tools/PdfRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PDFPrimitivesTest.cpp
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index b4ba0526a1f1d42daa3187cb984a1e56beebe1d4..0d623a13bb6b0a01e8ef1a3412e1dcc1822b87a5 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -39,9 +39,11 @@ private:
SkTDArray<SkPDFObject*> fResources;
};
-static bool encode_to_dct_stream(SkWStream* stream, const SkBitmap& bitmap, const SkIRect& rect) {
- stream->writeText("DCT compessed stream.");
- return true;
+#define DUMMY_TEXT "DCT compessed stream."
+
+static SkData* encode_to_dct_data(size_t* pixelRefOffset, const SkBitmap& bitmap) {
+ *pixelRefOffset = 0;
+ return SkData::NewWithProc(DUMMY_TEXT, sizeof(DUMMY_TEXT) - 1, NULL, NULL);
}
static bool stream_equals(const SkDynamicMemoryWStream& stream, size_t offset,
@@ -253,7 +255,7 @@ static void TestImage(skiatest::Reporter* reporter, const SkBitmap& bitmap,
SkAutoTUnref<SkPDFDevice> dev(new SkPDFDevice(pageSize, pageSize, SkMatrix::I()));
if (useDCTEncoder) {
- dev->setDCTEncoder(encode_to_dct_stream);
+ dev->setDCTEncoder(encode_to_dct_data);
}
SkCanvas c(dev);
« no previous file with comments | « src/pdf/SkPDFImage.cpp ('k') | tools/PdfRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698