SkStreamPriv.h 862 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright 2013 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef SkStreamPriv_DEFINED
  8. #define SkStreamPriv_DEFINED
  9. #include "include/core/SkRefCnt.h"
  10. class SkData;
  11. class SkStream;
  12. class SkWStream;
  13. /**
  14. * Copy the provided stream to an SkData variable.
  15. *
  16. * Note: Assumes the stream is at the beginning. If it has a length,
  17. * but is not at the beginning, this call will fail (return NULL).
  18. *
  19. * @param stream SkStream to be copied into data.
  20. * @return The resulting SkData after the copy, nullptr on failure.
  21. */
  22. sk_sp<SkData> SkCopyStreamToData(SkStream* stream);
  23. /**
  24. * Copies the input stream from the current position to the end.
  25. * Does not rewind the input stream.
  26. */
  27. bool SkStreamCopy(SkWStream* out, SkStream* input);
  28. #endif // SkStreamPriv_DEFINED