SkAndroidFrameworkUtils.h 990 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #ifndef SkAndroidFrameworkUtils_DEFINED
  8. #define SkAndroidFrameworkUtils_DEFINED
  9. #include "SkTypes.h"
  10. #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
  11. class SkCanvas;
  12. /**
  13. * SkAndroidFrameworkUtils expose private APIs used only by Android framework.
  14. */
  15. class SkAndroidFrameworkUtils {
  16. public:
  17. #if SK_SUPPORT_GPU
  18. /**
  19. * clipWithStencil draws the current clip into a stencil buffer with reference value and mask
  20. * set to 0x1. This function works only on a GPU canvas.
  21. *
  22. * @param canvas A GPU canvas that has a non-empty clip.
  23. *
  24. * @return true on success or false if clip is empty or not a GPU canvas.
  25. */
  26. static bool clipWithStencil(SkCanvas* canvas);
  27. #endif //SK_SUPPORT_GPU
  28. static void SafetyNetLog(const char*);
  29. };
  30. #endif // SK_BUILD_FOR_ANDROID_ANDROID
  31. #endif // SkAndroidFrameworkUtils_DEFINED