1 /* 2 * Copyright 2020 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 GrVkManagedResource_DEFINED 9 #define GrVkManagedResource_DEFINED 10 11 #include "src/gpu/ganesh/GrManagedResource.h" 12 13 class GrVkGpu; 14 15 class GrVkManagedResource : public GrManagedResource { 16 public: GrVkManagedResource(const GrVkGpu * gpu)17 GrVkManagedResource(const GrVkGpu* gpu) : fGpu(gpu) {} 18 19 protected: 20 const GrVkGpu* fGpu; // pointer to gpu object that can be used 21 // in subclass's freeGPUData() 22 23 private: 24 using INHERITED = GrManagedResource; 25 }; 26 27 class GrVkRecycledResource : public GrRecycledResource { 28 public: GrVkRecycledResource(GrVkGpu * gpu)29 GrVkRecycledResource(GrVkGpu* gpu) : fGpu(gpu) {} 30 31 protected: 32 GrVkGpu* fGpu; // pointer to gpu object that can be used 33 // in subclass's freeGPUData() and onRecycle(). 34 // mustn't be const 35 }; 36 37 #endif 38