blob: d3511c031f1a0c820dc8daace103f9aa3f8b8df8 [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"
10
Heather Millerb613c262016-11-10 21:25:30 +000011SkCanvas* SkSVGCanvas::Create(const SkRect& bounds, SkXMLWriter* writer) {
fmalita2aafe6f2015-02-06 12:51:10 -080012 // TODO: pass full bounds to the device
13 SkISize size = bounds.roundOut().size();
Hal Canary67b39de2016-11-07 11:47:44 -050014 sk_sp<SkBaseDevice> device(SkSVGDevice::Create(size, writer));
fmalita2aafe6f2015-02-06 12:51:10 -080015
Heather Millerb613c262016-11-10 21:25:30 +000016 return new SkCanvas(device.get());
fmalita2aafe6f2015-02-06 12:51:10 -080017}