Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/gfx/layers/wr/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  AsyncImagePipelineOp.h

  Sprache: C
 

/* 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 MOZILLA_GFX_AsyncImagePipelineOp_H
#define MOZILLA_GFX_AsyncImagePipelineOp_H

#include <queue>

#include "mozilla/layers/TextureHost.h"
#include "mozilla/RefPtr.h"
#include "mozilla/webrender/webrender_ffi.h"
#include "Units.h"

namespace mozilla {

namespace wr {
struct Transaction;
}  // namespace wr

namespace layers {

class AsyncImagePipelineManager;
class TextureHost;

class AsyncImagePipelineOp {
 public:
  enum class Tag {
    ApplyAsyncImageForPipeline,
    RemoveAsyncImagePipeline,
  };

  const Tag mTag;

  // Hold a strong reference: queued ops can outlive their owning
  // WebRenderBridgeParent and be processed after StopAndClearResources frees
  // the manager via a deferred remote-texture callback.
  const RefPtr<AsyncImagePipelineManager> mAsyncImageManager;
  const wr::PipelineId mPipelineId;
  const CompositableTextureHostRef mTextureHost;

  // Out-of-line so callers don't need the full AsyncImagePipelineManager type
  // to instantiate ~RefPtr<AsyncImagePipelineManager>.
  ~AsyncImagePipelineOp();
  AsyncImagePipelineOp(AsyncImagePipelineOp&&);
  AsyncImagePipelineOp(const AsyncImagePipelineOp&);

 private:
  AsyncImagePipelineOp(Tag aTag, AsyncImagePipelineManager* aAsyncImageManager,
                       const wr::PipelineId& aPipelineId,
                       TextureHost* aTextureHost);

  AsyncImagePipelineOp(Tag aTag, AsyncImagePipelineManager* aAsyncImageManager,
                       const wr::PipelineId& aPipelineId);

 public:
  static AsyncImagePipelineOp ApplyAsyncImageForPipeline(
      AsyncImagePipelineManager* aAsyncImageManager,
      const wr::PipelineId& aPipelineId, TextureHost* aTextureHost) {
    return AsyncImagePipelineOp(Tag::ApplyAsyncImageForPipeline,
                                aAsyncImageManager, aPipelineId, aTextureHost);
  }

  static AsyncImagePipelineOp RemoveAsyncImagePipeline(
      AsyncImagePipelineManager* aAsyncImageManager,
      const wr::PipelineId& aPipelineId) {
    return AsyncImagePipelineOp(Tag::RemoveAsyncImagePipeline,
                                aAsyncImageManager, aPipelineId);
  }
};

struct AsyncImagePipelineOps {
  explicit AsyncImagePipelineOps(wr::Transaction* aTransaction)
      : mTransaction(aTransaction) {}
  // Out-of-line so callers don't need the full AsyncImagePipelineManager type
  // to instantiate ~RefPtr<AsyncImagePipelineManager> for queued ops.
  ~AsyncImagePipelineOps();

  void HandleOps(wr::TransactionBuilder& aTxn);

  wr::Transaction* const mTransaction;
  std::queue<AsyncImagePipelineOp> mList;
};

}  // namespace layers
}  // namespace mozilla

#endif  // MOZILLA_GFX_AsyncImagePipelineOp_H

Messung V0.5 in Prozent
C=88 H=97 G=92

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.