blob: 95a4625417d5e9e0d2192f6341da547a7065b920 [file] [log] [blame]
fmalita2aafe6f2015-02-06 12:51:10 -08001/*
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
8#include "SkSVGCanvas.h"
9#include "SkSVGDevice.h"
Mike Reed5df49342016-11-12 08:06:55 -060010#include "SkMakeUnique.h"
fmalita2aafe6f2015-02-06 12:51:10 -080011
Mike Reed5df49342016-11-12 08:06:55 -060012std::unique_ptr<SkCanvas> SkSVGCanvas::Make(const SkRect& bounds, SkXMLWriter* writer) {
fmalita2aafe6f2015-02-06 12:51:10 -080013 // TODO: pass full bounds to the device
14 SkISize size = bounds.roundOut().size();
Hal Canary67b39de2016-11-07 11:47:44 -050015 sk_sp<SkBaseDevice> device(SkSVGDevice::Create(size, writer));
fmalita2aafe6f2015-02-06 12:51:10 -080016
Mike Reed5df49342016-11-12 08:06:55 -060017 return skstd::make_unique<SkCanvas>(device.get());
fmalita2aafe6f2015-02-06 12:51:10 -080018}