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

Unified Diff: src/images/SkStreamHelpers.h

Issue 23330002: Avoid getLength in ico decoder. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Respond to comments. Created 7 years, 4 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/images/SkImageDecoder_libico.cpp ('k') | src/images/SkStreamHelpers.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkStreamHelpers.h
diff --git a/src/images/SkStreamHelpers.h b/src/images/SkStreamHelpers.h
new file mode 100644
index 0000000000000000000000000000000000000000..7e766b7eccc45e15e89fe830ec6cc71f142a8961
--- /dev/null
+++ b/src/images/SkStreamHelpers.h
@@ -0,0 +1,27 @@
+/*
+ * 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 SkStreamHelpers_DEFINED
+#define SkStreamHelpers_DEFINED
+
+class SkAutoMalloc;
+class SkStream;
+
+/**
+ * Copy the provided stream to memory allocated by storage.
+ * Used by SkImageDecoder_libbmp and SkImageDecoder_libico.
+ * @param storage Allocator to hold the memory. Will be reset to be large
+ * enough to hold the entire stream. Upon successful return,
+ * storage->get() will point to data holding the SkStream's entire
+ * contents.
+ * @param stream SkStream to be copied into storage.
+ * @return size_t Total number of bytes in the SkStream, which is also the
+ * number of bytes pointed to by storage->get(). Returns 0 on failure.
+ */
+size_t CopyStreamToStorage(SkAutoMalloc* storage, SkStream* stream);
+
+#endif // SkStreamHelpers_DEFINED
« no previous file with comments | « src/images/SkImageDecoder_libico.cpp ('k') | src/images/SkStreamHelpers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698