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

Unified Diff: include/pdf/SkPDFCallbacks.h

Issue 24811002: Update the SkDocument interface to allow for 1) abort won't emit pdf, 2) close can report success/f… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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
Index: include/pdf/SkPDFCallbacks.h
diff --git a/include/pdf/SkPDFCallbacks.h b/include/pdf/SkPDFCallbacks.h
new file mode 100644
index 0000000000000000000000000000000000000000..1cf3232f5d5312075b95a2de3c0605c10905da02
--- /dev/null
+++ b/include/pdf/SkPDFCallbacks.h
@@ -0,0 +1,30 @@
+
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+
+#ifndef SkPDFCallbacks_DEFINED
+#define SkPDFCallbacks_DEFINED
+
+class SkBitmap;
+class SkIRect;
+class SkWStream;
+
+/** EncodeToDCTStream sets the DCTEncoder for images, to encode a bitmap as JPEG (DCT).
+ * Result of encodings are cached, if the encoder changes the
+ * behaivor dynamically and an image is added to a second catalog,
+ * we will likely use the result of the first encoding call.
+ * By returning false from the encoder function, the encoder result is not used.
+ * Callers might not want to encode small images, as the time spent
+ * encoding and decoding might not be worth the space savings, if any at all.
+ */
+
+typedef bool (*EncodeToDCTStream)(SkWStream* stream, const SkBitmap& bitmap, const SkIRect& rect);
scroggo 2013/09/26 22:05:55 Should these be inside a namespace?
+// TODO(edisonn): add here the ones about font, shadow render preferences,
+// how to export unsupported features, ...
+
+#endif // SkPDFCallbacks_DEFINED

Powered by Google App Engine
This is Rietveld 408576698