SkReduceOrder.h 858 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright 2012 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 SkReduceOrder_DEFINED
  8. #define SkReduceOrder_DEFINED
  9. #include "src/pathops/SkPathOpsCubic.h"
  10. #include "src/pathops/SkPathOpsLine.h"
  11. #include "src/pathops/SkPathOpsQuad.h"
  12. struct SkConic;
  13. union SkReduceOrder {
  14. enum Quadratics {
  15. kNo_Quadratics,
  16. kAllow_Quadratics
  17. };
  18. int reduce(const SkDCubic& cubic, Quadratics);
  19. int reduce(const SkDLine& line);
  20. int reduce(const SkDQuad& quad);
  21. static SkPath::Verb Conic(const SkConic& conic, SkPoint* reducePts);
  22. static SkPath::Verb Cubic(const SkPoint pts[4], SkPoint* reducePts);
  23. static SkPath::Verb Quad(const SkPoint pts[3], SkPoint* reducePts);
  24. SkDLine fLine;
  25. SkDQuad fQuad;
  26. SkDCubic fCubic;
  27. };
  28. #endif