SkBlurPriv.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright 2018 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 SkBlurPriv_DEFINED
  8. #define SkBlurPriv_DEFINED
  9. #include "include/core/SkRRect.h"
  10. #include "include/core/SkSize.h"
  11. static const int kSkBlurRRectMaxDivisions = 6;
  12. // This method computes all the parameters for drawing a partially occluded nine-patched
  13. // blurred rrect mask:
  14. // rrectToDraw - the integerized rrect to draw in the mask
  15. // widthHeight - how large to make the mask (rrectToDraw will be centered in this coord sys)
  16. // rectXs, rectYs - the x & y coordinates of the covering geometry lattice
  17. // texXs, texYs - the texture coordinate at each point in rectXs & rectYs
  18. // numXs, numYs - number of coordinates in the x & y directions
  19. // skipMask - bit mask that contains a 1-bit whenever one of the cells is occluded
  20. // It returns true if 'devRRect' is nine-patchable
  21. bool SkComputeBlurredRRectParams(const SkRRect& srcRRect, const SkRRect& devRRect,
  22. const SkRect& occluder,
  23. SkScalar sigma, SkScalar xformedSigma,
  24. SkRRect* rrectToDraw,
  25. SkISize* widthHeight,
  26. SkScalar rectXs[kSkBlurRRectMaxDivisions],
  27. SkScalar rectYs[kSkBlurRRectMaxDivisions],
  28. SkScalar texXs[kSkBlurRRectMaxDivisions],
  29. SkScalar texYs[kSkBlurRRectMaxDivisions],
  30. int* numXs, int* numYs, uint32_t* skipMask);
  31. extern void sk_register_blur_maskfilter_createproc();
  32. #endif