Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / skia / src / utils / SkTestCanvas.h
1 /*
2  * Copyright 2022 Google LLC
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 // SkTestCanvas is a simple way to make a testing canvas which is allowed to use private
9 // facilities of SkCanvas without having to add a friend to SkCanvas.h.
10 //
11 // You create a Key (a simple empty struct) to make a template specialization class. You need to
12 // make a key for each of the different Canvases you need. The implementations of the canvases
13 // are in SkCanvas.cpp, which allows the use of helper classes.
14
15 #ifndef SkTestCanvas_DEFINED
16 #define SkTestCanvas_DEFINED
17
18 #include "include/core/SkSize.h"
19 #include "include/utils/SkNWayCanvas.h"
20 #include "src/core/SkDevice.h"
21 #include "src/core/SkGlyphRun.h"
22
23 // You can only make template specializations of SkTestCanvas.
24 template <typename Key> class SkTestCanvas;
25
26 // A test canvas to test using slug rendering instead of text blob rendering.
27 struct SkSlugTestKey {};
28 template <>
29 class SkTestCanvas<SkSlugTestKey> : public SkCanvas {
30 public:
31     SkTestCanvas(SkCanvas* canvas);
32     void onDrawGlyphRunList(const SkGlyphRunList& glyphRunList, const SkPaint& paint) override;
33 };
34
35 #endif  // SkTestCanvas_DEFINED