Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / skia / src / gpu / graphite / Log.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 #ifndef skgpu_graphite_Log_DEFINED
9 #define skgpu_graphite_Log_DEFINED
10
11 namespace skgpu::graphite {
12 enum class Priority : int {
13     kError = 0,
14     kWarning = 1,
15     kDebug = 2,
16 };
17 };  // namespace skgpu::graphite
18
19 #if !defined(SKGPU_LOWEST_ACTIVE_PRIORITY)
20 #ifdef SK_DEBUG
21     #define SKGPU_LOWEST_ACTIVE_PRIORITY Priority::kWarning
22 #else
23     #define SKGPU_LOWEST_ACTIVE_PRIORITY Priority::kError
24 #endif
25 #endif
26 #define SKGPU_LOG(priority, fmt, ...) \
27     do { \
28         if (priority <= SKGPU_LOWEST_ACTIVE_PRIORITY) { \
29             SkDebugf("[graphite] " fmt "\n", ##__VA_ARGS__); \
30         } \
31     } while (0)
32 #define SKGPU_LOG_E(fmt, ...) SKGPU_LOG(Priority::kError, "** ERROR ** " fmt, ##__VA_ARGS__)
33 #define SKGPU_LOG_W(fmt, ...) SKGPU_LOG(Priority::kWarning, "WARNING - " fmt, ##__VA_ARGS__)
34 #define SKGPU_LOG_D(fmt, ...) SKGPU_LOG(Priority::kDebug, fmt, ##__VA_ARGS__)
35
36 #endif // skgpu_graphite_Log_DEFINED