SkNullCanvas.cpp 512 B

123456789101112131415161718
  1. /*
  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. #include "include/utils/SkNullCanvas.h"
  8. #include "include/core/SkCanvas.h"
  9. #include "include/utils/SkNWayCanvas.h"
  10. #include "src/core/SkMakeUnique.h"
  11. std::unique_ptr<SkCanvas> SkMakeNullCanvas() {
  12. // An N-Way canvas forwards calls to N canvas's. When N == 0 it's
  13. // effectively a null canvas.
  14. return std::unique_ptr<SkCanvas>(new SkNWayCanvas(0, 0));
  15. }