Stan Iliev | 73d8fd9 | 2017-08-02 15:36:24 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 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 | #ifndef SkAndroidFrameworkUtils_DEFINED |
| 9 | #define SkAndroidFrameworkUtils_DEFINED |
| 10 | |
| 11 | #include "SkTypes.h" |
| 12 | |
| 13 | #ifdef SK_BUILD_FOR_ANDROID |
| 14 | |
| 15 | class SkCanvas; |
| 16 | |
| 17 | /** |
| 18 | * SkAndroidFrameworkUtils expose private APIs used only by Android framework. |
| 19 | */ |
| 20 | class SkAndroidFrameworkUtils { |
| 21 | public: |
| 22 | |
| 23 | #if SK_SUPPORT_GPU |
| 24 | /** |
| 25 | * clipWithStencil draws the current clip into a stencil buffer with reference value and mask |
| 26 | * set to 0x1. This function works only on a GPU canvas. |
| 27 | * |
| 28 | * @param canvas A GPU canvas that has a non-empty clip. |
| 29 | * |
| 30 | * @return true on success or false if clip is empty or not a GPU canvas. |
| 31 | */ |
| 32 | static bool clipWithStencil(SkCanvas* canvas); |
| 33 | #endif //SK_SUPPORT_GPU |
| 34 | }; |
| 35 | |
| 36 | #endif // SK_BUILD_FOR_ANDROID |
| 37 | |
| 38 | #endif // SkAndroidFrameworkUtils_DEFINED |