tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

RenderBundle.h (1140B)


      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_RenderBundle_H_
      7 #define GPU_RenderBundle_H_
      8 
      9 #include "CanvasContext.h"
     10 #include "ObjectModel.h"
     11 #include "nsWrapperCache.h"
     12 
     13 namespace mozilla::webgpu {
     14 
     15 class Device;
     16 
     17 class RenderBundle final : public nsWrapperCache,
     18                           public ObjectBase,
     19                           public ChildOf<Device> {
     20 public:
     21  GPU_DECL_CYCLE_COLLECTION(RenderBundle)
     22  GPU_DECL_JS_WRAP(RenderBundle)
     23 
     24  RenderBundle(Device* const aParent, RawId aId,
     25               CanvasContextArray&& aCanvasContexts);
     26 
     27  mozilla::Span<const WeakPtr<CanvasContext>> GetCanvasContexts() const {
     28    return mUsedCanvasContexts;
     29  }
     30 
     31 private:
     32  virtual ~RenderBundle();
     33 
     34  // The canvas contexts of any canvas textures used in this render bundle.
     35  CanvasContextArray mUsedCanvasContexts;
     36 };
     37 
     38 }  // namespace mozilla::webgpu
     39 
     40 #endif  // GPU_RenderBundle_H_