NativeLayerCommandQueue.cpp (864B)
1 /* -*- Mode: C++; tab-width: 2; 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 "mozilla/layers/NativeLayerCommandQueue.h" 7 8 namespace mozilla { 9 namespace layers { 10 11 NativeLayerCommandQueue::NativeLayerCommandQueue() 12 : mQueue("NativeLayerCommandQueue") {} 13 14 void NativeLayerCommandQueue::AppendCommand( 15 mozilla::layers::NativeLayerCommand&& aCommand) { 16 auto q = mQueue.Lock(); 17 q->AppendElement(std::move(aCommand)); 18 } 19 20 void NativeLayerCommandQueue::FlushToArray( 21 nsTArray<mozilla::layers::NativeLayerCommand>& aQueue) { 22 auto q = mQueue.Lock(); 23 aQueue.AppendElements(std::move(*q)); 24 } 25 26 } // namespace layers 27 } // namespace mozilla