skia_paint_image_generator.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2017 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 CC_PAINT_SKIA_PAINT_IMAGE_GENERATOR_H_
  5. #define CC_PAINT_SKIA_PAINT_IMAGE_GENERATOR_H_
  6. #include "cc/paint/paint_export.h"
  7. #include "cc/paint/paint_image.h"
  8. #include "third_party/skia/include/core/SkImageGenerator.h"
  9. namespace cc {
  10. class PaintImageGenerator;
  11. class CC_PAINT_EXPORT SkiaPaintImageGenerator final : public SkImageGenerator {
  12. public:
  13. SkiaPaintImageGenerator(sk_sp<PaintImageGenerator> paint_image_generator,
  14. size_t frame_index,
  15. PaintImage::GeneratorClientId client_id);
  16. SkiaPaintImageGenerator(const SkiaPaintImageGenerator&) = delete;
  17. ~SkiaPaintImageGenerator() override;
  18. SkiaPaintImageGenerator& operator=(const SkiaPaintImageGenerator&) = delete;
  19. sk_sp<SkData> onRefEncodedData() override;
  20. bool onGetPixels(const SkImageInfo&,
  21. void* pixels,
  22. size_t row_bytes,
  23. const Options& options) override;
  24. bool onQueryYUVAInfo(
  25. const SkYUVAPixmapInfo::SupportedDataTypes& supported_data_types,
  26. SkYUVAPixmapInfo* yuva_pixmap_info) const override;
  27. bool onGetYUVAPlanes(const SkYUVAPixmaps& planes) override;
  28. private:
  29. sk_sp<PaintImageGenerator> paint_image_generator_;
  30. const size_t frame_index_;
  31. const PaintImage::GeneratorClientId client_id_;
  32. };
  33. } // namespace cc
  34. #endif // CC_PAINT_SKIA_PAINT_IMAGE_GENERATOR_H_