/cocos2dx/platform/third_party/blackberry/include/grskia/SkDashPathEffect.h

https://bitbucket.org/Tsiannian/cocos2d-x · C++ Header · 65 lines · 23 code · 11 blank · 31 comment · 0 complexity · 081229e469661b3e10881cf6a3bd5a0f MD5 · raw file

  1. /*
  2. * Copyright (C) 2006 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef SkDashPathEffect_DEFINED
  17. #define SkDashPathEffect_DEFINED
  18. #include "SkPathEffect.h"
  19. /** \class SkDashPathEffect
  20. SkDashPathEffect is a subclass of SkPathEffect that implements dashing
  21. */
  22. class SK_API SkDashPathEffect : public SkPathEffect {
  23. public:
  24. /** The intervals array must contain an even number of entries (>=2), with the even
  25. indices specifying the "on" intervals, and the odd indices specifying the "off"
  26. intervals. phase is an offset into the intervals array (mod the sum of all of the
  27. intervals).
  28. Note: only affects framed paths
  29. */
  30. SkDashPathEffect(const SkScalar intervals[], int count, SkScalar phase, bool scaleToFit = false);
  31. virtual ~SkDashPathEffect();
  32. // overrides for SkPathEffect
  33. // This method is not exported to java.
  34. virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
  35. // overrides for SkFlattenable
  36. // This method is not exported to java.
  37. virtual Factory getFactory();
  38. // This method is not exported to java.
  39. virtual void flatten(SkFlattenableWriteBuffer&);
  40. static SkFlattenable* CreateProc(SkFlattenableReadBuffer&);
  41. protected:
  42. SkDashPathEffect(SkFlattenableReadBuffer&);
  43. private:
  44. SkScalar* fIntervals;
  45. int32_t fCount;
  46. // computed from phase
  47. SkScalar fInitialDashLength;
  48. int32_t fInitialDashIndex;
  49. SkScalar fIntervalLength;
  50. bool fScaleToFit;
  51. typedef SkPathEffect INHERITED;
  52. };
  53. #endif