skia_path_common.h 750 B

1234567891011121314151617181920212223242526
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef TESTING_LIBFUZZER_FUZZERS_SKIA_PATH_COMMON_H_
  5. #define TESTING_LIBFUZZER_FUZZERS_SKIA_PATH_COMMON_H_
  6. #include "third_party/skia/include/core/SkPath.h"
  7. template <typename T>
  8. static bool read(const uint8_t** data, size_t* size, T* value) {
  9. if (*size < sizeof(T))
  10. return false;
  11. *value = *reinterpret_cast<const T*>(*data);
  12. *data += sizeof(T);
  13. *size -= sizeof(T);
  14. return true;
  15. }
  16. void BuildPath(const uint8_t** data,
  17. size_t* size,
  18. SkPath* path,
  19. int last_verb);
  20. #endif // TESTING_LIBFUZZER_FUZZERS_SKIA_PATH_COMMON_H_