• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2021 Google LLC
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 
8 #ifndef skgpu_Texture_DEFINED
9 #define skgpu_Texture_DEFINED
10 
11 #include "experimental/graphite/include/TextureInfo.h"
12 #include "include/core/SkRefCnt.h"
13 #include "include/core/SkSize.h"
14 
15 namespace skgpu {
16 
17 class Texture : public SkRefCnt {
18 public:
19     ~Texture() override;
20 
numSamples()21     int numSamples() const { return fInfo.numSamples(); }
mipmapped()22     Mipmapped mipmapped() const { return Mipmapped(fInfo.numMipLevels() > 1); }
23 
dimensions()24     SkISize dimensions() const { return fDimensions; }
textureInfo()25     const TextureInfo& textureInfo() const { return fInfo; }
26 
27 protected:
28     Texture(SkISize dimensions, const TextureInfo& info);
29 
30 private:
31     SkISize fDimensions;
32     TextureInfo fInfo;
33 };
34 
35 } // namepsace skgpu
36 
37 #endif // skgpu_Texture_DEFINED
38