blob: a3d95e537c75168c7dbf95e872fbb1c36a7c9b6e [file] [log] [blame]
* Copyright 2021 Google LLC
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#ifndef skgpu_TextureProxy_DEFINED
#define skgpu_TextureProxy_DEFINED
#include "experimental/graphite/include/TextureInfo.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkSize.h"
namespace skgpu {
class ResourceProvider;
class Texture;
class TextureProxy : public SkRefCnt {
TextureProxy(SkISize dimensions, const TextureInfo& info);
~TextureProxy() override;
int numSamples() const { return fInfo.numSamples(); }
Mipmapped mipmapped() const { return Mipmapped(fInfo.numMipLevels() > 1); }
SkISize dimensions() const { return fDimensions; }
const TextureInfo& textureInfo() const { return fInfo; }
bool instantiate(ResourceProvider*);
sk_sp<Texture> refTexture() const;
const Texture* texture() const;
#ifdef SK_DEBUG
void validateTexture(const Texture*);
SkISize fDimensions;
TextureInfo fInfo;
sk_sp<Texture> fTexture;
} // namepsace skgpu
#endif // skgpu_TextureProxy_DEFINED