TextureView.h (962B)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 #ifndef GPU_TextureView_H_ 7 #define GPU_TextureView_H_ 8 9 #include "CanvasContext.h" 10 #include "ObjectModel.h" 11 #include "mozilla/webgpu/WebGPUTypes.h" 12 #include "nsWrapperCache.h" 13 14 namespace mozilla::webgpu { 15 16 class CanvasContext; 17 class Texture; 18 19 class TextureView final : public nsWrapperCache, 20 public ObjectBase, 21 public ChildOf<Texture> { 22 public: 23 GPU_DECL_CYCLE_COLLECTION(TextureView) 24 GPU_DECL_JS_WRAP(TextureView) 25 26 TextureView(Texture* const aParent, RawId aId); 27 WeakPtr<CanvasContext> GetTargetContext() const; 28 29 private: 30 virtual ~TextureView(); 31 }; 32 33 } // namespace mozilla::webgpu 34 35 #endif // GPU_TextureView_H_