mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 10:15:41 +00:00
b91906eeac
This mostly updates the bindings to the current state. No actual logic backing them yet. *Note*: the IDL does *not* need to be checked for matching the upstream spec precisely at this stage. The upstream is evolving, we just need to update in order to start integrating the implementation. What needs to be checked is - how C++ represents the IDL, esp with regards to derived classes, events, and hierarchies. The trickiest points, arguably, are: - WebGPU -> GPU prefix change - the goop for interfaces that are not final Differential Revision: https://phabricator.services.mozilla.com/D46166 --HG-- rename : dom/webgpu/InputState.cpp => dom/webgpu/DeviceLostInfo.cpp rename : dom/webgpu/Fence.h => dom/webgpu/DeviceLostInfo.h rename : dom/webgpu/BlendState.cpp => dom/webgpu/OutOfMemoryError.cpp rename : dom/webgpu/LogEntry.h => dom/webgpu/OutOfMemoryError.h rename : dom/webgpu/BindGroup.h => dom/webgpu/ProgrammablePassEncoder.cpp rename : dom/webgpu/BlendState.cpp => dom/webgpu/RenderBundle.cpp rename : dom/webgpu/BlendState.h => dom/webgpu/RenderBundle.h rename : dom/webgpu/AttachmentState.cpp => dom/webgpu/ValidationError.cpp rename : dom/webgpu/AttachmentState.h => dom/webgpu/ValidationError.h extra : moz-landing-system : lando
56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef GPU_INSTANCE_PROVIDER_H_
|
|
#define GPU_INSTANCE_PROVIDER_H_
|
|
|
|
#include "mozilla/AlreadyAddRefed.h"
|
|
#include "mozilla/Maybe.h"
|
|
#include "mozilla/RefPtr.h"
|
|
|
|
class nsCycleCollectionTraversalCallback;
|
|
class nsIGlobalObject;
|
|
|
|
namespace mozilla {
|
|
namespace webgpu {
|
|
class Instance;
|
|
|
|
class InstanceProvider {
|
|
private:
|
|
nsIGlobalObject* const mGlobal;
|
|
mutable Maybe<RefPtr<Instance>> mInstance;
|
|
|
|
protected:
|
|
explicit InstanceProvider(nsIGlobalObject* global);
|
|
virtual ~InstanceProvider();
|
|
|
|
public:
|
|
already_AddRefed<Instance> Webgpu() const;
|
|
|
|
nsIGlobalObject* GetParentObject() const { return mGlobal; }
|
|
|
|
void CcTraverse(nsCycleCollectionTraversalCallback&) const;
|
|
void CcUnlink();
|
|
};
|
|
|
|
template <typename T>
|
|
void ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& callback,
|
|
const Maybe<T>& field, const char* name,
|
|
uint32_t flags) {
|
|
if (field) {
|
|
CycleCollectionNoteChild(callback, field.value(), name, flags);
|
|
}
|
|
}
|
|
|
|
template <typename T>
|
|
void ImplCycleCollectionUnlink(Maybe<T>& field) {
|
|
field = Nothing();
|
|
}
|
|
|
|
} // namespace webgpu
|
|
} // namespace mozilla
|
|
|
|
#endif // GPU_INSTANCE_PROVIDER_H_
|