SkNormalFlatSource.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright 2016 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 SkNormalFlatSource_DEFINED
  8. #define SkNormalFlatSource_DEFINED
  9. #include "src/core/SkNormalSource.h"
  10. class SK_API SkNormalFlatSourceImpl : public SkNormalSource {
  11. public:
  12. SkNormalFlatSourceImpl(){}
  13. #if SK_SUPPORT_GPU
  14. std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs& args) const override;
  15. #endif
  16. SkNormalSource::Provider* asProvider(const SkShaderBase::ContextRec& rec,
  17. SkArenaAlloc* alloc) const override;
  18. protected:
  19. void flatten(SkWriteBuffer& buf) const override;
  20. private:
  21. SK_FLATTENABLE_HOOKS(SkNormalFlatSourceImpl)
  22. class Provider : public SkNormalSource::Provider {
  23. public:
  24. Provider();
  25. ~Provider() override;
  26. void fillScanLine(int x, int y, SkPoint3 output[], int count) const override;
  27. private:
  28. typedef SkNormalSource::Provider INHERITED;
  29. };
  30. friend class SkNormalSource;
  31. typedef SkNormalSource INHERITED;
  32. };
  33. #endif