9301fe3779
This will use the recently added Bazel toolchain feature to enforce proper includes for all files in //src/svg/... In the future, I envision a CI/CQ job that will run bazel build with a few different configurations and the --feature skia_enforce_iwyu on to make sure we don't regress. Change-Id: Ibb9f816ab626415c11bd2b9b74c503297c4b0723 Bug: skia:13052 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521036 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
/*
|
|
* Copyright 2015 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef SkSVGCanvas_DEFINED
|
|
#define SkSVGCanvas_DEFINED
|
|
|
|
#include "include/core/SkTypes.h"
|
|
|
|
#include <memory>
|
|
|
|
class SkCanvas;
|
|
class SkWStream;
|
|
struct SkRect;
|
|
|
|
class SK_API SkSVGCanvas {
|
|
public:
|
|
enum {
|
|
kConvertTextToPaths_Flag = 0x01, // emit text as <path>s
|
|
kNoPrettyXML_Flag = 0x02, // suppress newlines and tabs in output
|
|
kRelativePathEncoding_Flag = 0x04, // use relative commands for path encoding
|
|
};
|
|
|
|
/**
|
|
* Returns a new canvas that will generate SVG commands from its draw calls, and send
|
|
* them to the provided stream. Ownership of the stream is not transfered, and it must
|
|
* remain valid for the lifetime of the returned canvas.
|
|
*
|
|
* The canvas may buffer some drawing calls, so the output is not guaranteed to be valid
|
|
* or complete until the canvas instance is deleted.
|
|
*
|
|
* The 'bounds' parameter defines an initial SVG viewport (viewBox attribute on the root
|
|
* SVG element).
|
|
*/
|
|
static std::unique_ptr<SkCanvas> Make(const SkRect& bounds, SkWStream*, uint32_t flags = 0);
|
|
};
|
|
|
|
#endif
|