tor-browser

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

AsyncImagePipelineOp.cpp (1380B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "AsyncImagePipelineOp.h"
      8 
      9 #include "mozilla/layers/AsyncImagePipelineManager.h"
     10 
     11 namespace mozilla {
     12 namespace layers {
     13 
     14 void AsyncImagePipelineOps::HandleOps(wr::TransactionBuilder& aTxn) {
     15  MOZ_ASSERT(!mList.empty());
     16 
     17  while (!mList.empty()) {
     18    auto& frontOp = mList.front();
     19    switch (frontOp.mTag) {
     20      case AsyncImagePipelineOp::Tag::ApplyAsyncImageForPipeline: {
     21        auto* manager = frontOp.mAsyncImageManager;
     22        const auto& pipelineId = frontOp.mPipelineId;
     23        const auto& textureHost = frontOp.mTextureHost;
     24 
     25        manager->ApplyAsyncImageForPipeline(pipelineId, textureHost, aTxn);
     26        break;
     27      }
     28      case AsyncImagePipelineOp::Tag::RemoveAsyncImagePipeline: {
     29        auto* manager = frontOp.mAsyncImageManager;
     30        const auto& pipelineId = frontOp.mPipelineId;
     31        manager->RemoveAsyncImagePipeline(pipelineId, /* aPendingOps */ nullptr,
     32                                          aTxn);
     33        break;
     34      }
     35    }
     36    mList.pop();
     37  }
     38 }
     39 
     40 }  // namespace layers
     41 }  // namespace mozilla