CompositorTypes.cpp (1835B)
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 "CompositorTypes.h" 8 9 #include <ostream> 10 11 namespace mozilla { 12 namespace layers { 13 14 std::ostream& operator<<(std::ostream& aStream, const TextureFlags& aFlags) { 15 if (aFlags == TextureFlags::NO_FLAGS) { 16 aStream << "NoFlags"; 17 } else { 18 #define AppendFlag(test) \ 19 { \ 20 if (!!(aFlags & (test))) { \ 21 if (previous) { \ 22 aStream << "|"; \ 23 } \ 24 aStream << #test; \ 25 previous = true; \ 26 } \ 27 } 28 bool previous = false; 29 AppendFlag(TextureFlags::USE_NEAREST_FILTER); 30 AppendFlag(TextureFlags::ORIGIN_BOTTOM_LEFT); 31 AppendFlag(TextureFlags::DISALLOW_BIGIMAGE); 32 AppendFlag(TextureFlags::RB_SWAPPED); 33 AppendFlag(TextureFlags::NON_PREMULTIPLIED); 34 AppendFlag(TextureFlags::RECYCLE); 35 AppendFlag(TextureFlags::DEALLOCATE_CLIENT); 36 AppendFlag(TextureFlags::DEALLOCATE_SYNC); 37 AppendFlag(TextureFlags::IMMUTABLE); 38 AppendFlag(TextureFlags::IMMEDIATE_UPLOAD); 39 AppendFlag(TextureFlags::COMPONENT_ALPHA); 40 AppendFlag(TextureFlags::INVALID_COMPOSITOR); 41 AppendFlag(TextureFlags::RGB_FROM_YCBCR); 42 AppendFlag(TextureFlags::SNAPSHOT); 43 AppendFlag(TextureFlags::NON_BLOCKING_READ_LOCK); 44 AppendFlag(TextureFlags::BLOCKING_READ_LOCK); 45 AppendFlag(TextureFlags::WAIT_HOST_USAGE_END); 46 AppendFlag(TextureFlags::IS_OPAQUE); 47 #undef AppendFlag 48 } 49 return aStream; 50 } 51 52 } // namespace layers 53 } // namespace mozilla