/* * Copyright 2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkPictureImageGenerator_DEFINED #define SkPictureImageGenerator_DEFINED #include "SkImageGenerator.h" #include "SkTLazy.h" class SkPictureImageGenerator : public SkImageGenerator { public: static std::unique_ptr Make(const SkISize&, sk_sp, const SkMatrix*, const SkPaint*, SkImage::BitDepth, sk_sp); protected: bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options& opts) override; #if SK_SUPPORT_GPU TexGenType onCanGenerateTexture() const override { return TexGenType::kExpensive; } sk_sp onGenerateTexture(GrContext*, const SkImageInfo&, const SkIPoint&, bool willNeedMipMaps) override; #endif private: SkPictureImageGenerator(const SkImageInfo& info, sk_sp, const SkMatrix*, const SkPaint*); sk_sp fPicture; SkMatrix fMatrix; SkTLazy fPaint; typedef SkImageGenerator INHERITED; }; #endif // SkPictureImageGenerator_DEFINED