blob: 1f28706e20c5385f2d7ed2db3155831c69cb017b [file] [log] [blame]
bsalomon@google.com19bbd3d2012-06-11 15:39:15 +00001/*
2 * Copyright 2012 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 "SkNullCanvas.h"
9
10#include "SkCanvas.h"
bsalomon@google.com7f7dd732012-06-11 15:55:58 +000011#include "SkNWayCanvas.h"
Mike Reed5df49342016-11-12 08:06:55 -060012#include "SkMakeUnique.h"
bsalomon@google.com19bbd3d2012-06-11 15:39:15 +000013
Mike Reed5df49342016-11-12 08:06:55 -060014std::unique_ptr<SkCanvas> SkMakeNullCanvas() {
bsalomon@google.com19bbd3d2012-06-11 15:39:15 +000015 // An N-Way canvas forwards calls to N canvas's. When N == 0 it's
16 // effectively a null canvas.
Mike Reed5df49342016-11-12 08:06:55 -060017 return std::unique_ptr<SkCanvas>(new SkNWayCanvas(0, 0));
bsalomon@google.com19bbd3d2012-06-11 15:39:15 +000018}