Robert Phillips | 09b2bcb | 2021-05-12 11:56:47 -0400 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2021 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 SkBaseGpuDevice_DEFINED |
| 9 | #define SkBaseGpuDevice_DEFINED |
| 10 | |
| 11 | // NOTE: when not defined, SkGpuDevice extends SkBaseDevice directly and manages its clip stack |
| 12 | // using GrClipStack. When false, SkGpuDevice continues to extend SkClipStackDevice and uses |
| 13 | // SkClipStack and GrClipStackClip to manage the clip stack. |
| 14 | #if !defined(SK_DISABLE_NEW_GR_CLIP_STACK) |
| 15 | // For staging purposes, disable this for Android Framework |
| 16 | #if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) |
| 17 | #define SK_DISABLE_NEW_GR_CLIP_STACK |
| 18 | #endif |
| 19 | #endif |
| 20 | |
| 21 | #if !defined(SK_DISABLE_NEW_GR_CLIP_STACK) |
| 22 | #include "src/core/SkDevice.h" |
| 23 | #define BASE_DEVICE SkBaseDevice |
| 24 | #else |
| 25 | #include "src/core/SkClipStackDevice.h" |
| 26 | #define BASE_DEVICE SkClipStackDevice |
| 27 | #endif |
| 28 | |
| 29 | class SkBaseGpuDevice : public BASE_DEVICE { |
| 30 | public: |
| 31 | SkBaseGpuDevice(const SkImageInfo& ii, const SkSurfaceProps& props) |
| 32 | : INHERITED(ii, props) { |
| 33 | } |
| 34 | |
| 35 | // TODO: SkGpuDevice/SkGpuDevice_nga shared stuff goes here |
| 36 | |
| 37 | protected: |
| 38 | |
| 39 | private: |
| 40 | using INHERITED = BASE_DEVICE; |
| 41 | }; |
| 42 | |
| 43 | #undef BASE_DEVICE |
| 44 | |
| 45 | #endif |