TextureView.cpp (911B)
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 #include "TextureView.h" 7 8 #include "Device.h" 9 #include "ipc/WebGPUChild.h" 10 #include "mozilla/dom/WebGPUBinding.h" 11 #include "mozilla/webgpu/CanvasContext.h" 12 13 namespace mozilla::webgpu { 14 15 GPU_IMPL_CYCLE_COLLECTION(TextureView, mParent) 16 GPU_IMPL_JS_WRAP(TextureView) 17 18 TextureView::TextureView(Texture* const aParent, RawId aId) 19 : ObjectBase(aParent->GetChild(), aId, ffi::wgpu_client_drop_texture_view), 20 ChildOf(aParent) {} 21 22 TextureView::~TextureView() = default; 23 24 WeakPtr<CanvasContext> TextureView::GetTargetContext() const { 25 return mParent->mTargetContext; 26 } // namespace webgpu 27 28 } // namespace mozilla::webgpu