chromium/third_party/skia/include/gpu/ganesh/GrExternalTextureGenerator.h

/*
 * Copyright 2023 Google LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrExternalTextureGenerator_DEFINED
#define GrExternalTextureGenerator_DEFINED

#include "include/core/SkRefCnt.h"
#include "include/gpu/ganesh/GrBackendSurface.h"
#include "include/private/base/SkAPI.h"
#include "include/private/gpu/ganesh/GrTextureGenerator.h"

#include <memory>

class GrRecordingContext;
class GrSurfaceProxyView;
class SkImage;
enum class GrImageTexGenPolicy : int;
namespace skgpu { enum class Mipmapped : bool; }
struct SkImageInfo;

class GrExternalTexture {};

class SK_API GrExternalTextureGenerator : public GrTextureGenerator {};

namespace SkImages {
/**
 *   Like SkImages::DeferredFromGenerator except allows for the use of GrTextureGenerator.
 *
 *   @param gen producer of textures
 *   @return    created SkImage, or nullptr
 */
SK_API sk_sp<SkImage> DeferredFromTextureGenerator(std::unique_ptr<GrTextureGenerator> gen);
}

#endif  // GrExternalTextureGenerator_DEFINED