SkSVGCanvas.h 1002 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright 2015 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 SkSVGCanvas_DEFINED
  8. #define SkSVGCanvas_DEFINED
  9. #include "include/core/SkCanvas.h"
  10. class SkWStream;
  11. class SK_API SkSVGCanvas {
  12. public:
  13. enum {
  14. kConvertTextToPaths_Flag = 0x01,
  15. };
  16. /**
  17. * Returns a new canvas that will generate SVG commands from its draw calls, and send
  18. * them to the provided stream. Ownership of the stream is not transfered, and it must
  19. * remain valid for the lifetime of the returned canvas.
  20. *
  21. * The canvas may buffer some drawing calls, so the output is not guaranteed to be valid
  22. * or complete until the canvas instance is deleted.
  23. *
  24. * The 'bounds' parameter defines an initial SVG viewport (viewBox attribute on the root
  25. * SVG element).
  26. */
  27. static std::unique_ptr<SkCanvas> Make(const SkRect& bounds, SkWStream*, uint32_t flags = 0);
  28. };
  29. #endif