OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrVkTexture_DEFINED | 8 #ifndef GrVkTexture_DEFINED |
9 #define GrVkTexture_DEFINED | 9 #define GrVkTexture_DEFINED |
10 | 10 |
11 #include "GrGpu.h" | 11 #include "GrGpu.h" |
12 #include "GrTexture.h" | 12 #include "GrTexture.h" |
13 #include "GrVkImage.h" | 13 #include "GrVkImage.h" |
14 | 14 |
15 class GrVkGpu; | 15 class GrVkGpu; |
16 class GrVkImageView; | 16 class GrVkImageView; |
17 struct GrVkTextureInfo; | 17 struct GrVkTextureInfo; |
18 | 18 |
19 class GrVkTexture : public GrTexture, public virtual GrVkImage { | 19 class GrVkTexture : public GrTexture, public virtual GrVkImage { |
20 public: | 20 public: |
21 static GrVkTexture* CreateNewTexture(GrVkGpu*, const GrSurfaceDesc&, | 21 static GrVkTexture* CreateNewTexture(GrVkGpu*, const GrSurfaceDesc&, |
22 GrGpuResource::LifeCycle, | 22 GrGpuResource::LifeCycle, |
23 const GrVkImage::ImageDesc&); | 23 const GrVkImage::ImageDesc&); |
24 | 24 |
25 static GrVkTexture* CreateWrappedTexture(GrVkGpu*, const GrSurfaceDesc&, | 25 static GrVkTexture* CreateWrappedTexture(GrVkGpu*, const GrSurfaceDesc&, |
26 GrGpuResource::LifeCycle, | 26 GrGpuResource::LifeCycle, |
27 VkFormat, const GrVkTextureInfo*); | 27 VkFormat, const GrVkTextureInfo*); |
28 | 28 |
29 ~GrVkTexture() override; | 29 ~GrVkTexture() override; |
30 | 30 |
31 GrBackendObject getTextureHandle() const override; | 31 GrBackendObject getTextureHandle() const override; |
32 | 32 |
33 void textureParamsModified() override {} | 33 void textureParamsModified() override {} |
34 | 34 |
35 const GrVkImageView* textureView() const { return fTextureView; } | 35 const GrVkImageView* textureView() const { return fTextureView; } |
36 | 36 |
37 protected: | 37 protected: |
38 enum Derived { kDerived }; | 38 enum Derived { kDerived }; |
39 | 39 |
40 GrVkTexture(GrVkGpu*, const GrSurfaceDesc&, GrGpuResource::LifeCycle, | 40 GrVkTexture(GrVkGpu*, const GrSurfaceDesc&, GrGpuResource::LifeCycle, |
41 const GrVkImage::Resource*, const GrVkImageView* imageView); | 41 const GrVkImage::Resource*, const GrVkImageView* imageView); |
42 | 42 |
43 GrVkTexture(GrVkGpu*, const GrSurfaceDesc&, GrGpuResource::LifeCycle, | 43 GrVkTexture(GrVkGpu*, const GrSurfaceDesc&, GrGpuResource::LifeCycle, |
44 const GrVkImage::Resource*, const GrVkImageView* imageView, Deri
ved); | 44 const GrVkImage::Resource*, const GrVkImageView* imageView, Deri
ved); |
45 | 45 |
46 static GrVkTexture* Create(GrVkGpu*, const GrSurfaceDesc&, | 46 static GrVkTexture* Create(GrVkGpu*, const GrSurfaceDesc&, |
47 GrGpuResource::LifeCycle, VkFormat, | 47 GrGpuResource::LifeCycle, VkFormat, |
48 const GrVkImage::Resource* texImpl); | 48 const GrVkImage::Resource* texImpl); |
49 | 49 |
50 GrVkGpu* getVkGpu() const; | 50 GrVkGpu* getVkGpu() const; |
51 | 51 |
52 void onAbandon() override; | 52 void onAbandon() override; |
53 void onRelease() override; | 53 void onRelease() override; |
54 | 54 |
55 private: | 55 private: |
56 const GrVkImageView* fTextureView; | 56 const GrVkImageView* fTextureView; |
57 | 57 |
58 typedef GrTexture INHERITED; | 58 typedef GrTexture INHERITED; |
59 }; | 59 }; |
60 | 60 |
61 #endif | 61 #endif |
OLD | NEW |