1 // Copyright 2023 The Android Open Source Project 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expresso or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #include "magma/Decoder.h" 18 19 struct RenderThreadInfoMagma { 20 // Create new instance. Only call this once per thread. 21 // Future calls to get() will return this instance until 22 // it is destroyed. 23 RenderThreadInfoMagma(uint32_t context_id); 24 25 // Destructor. 26 ~RenderThreadInfoMagma(); 27 28 // Return the current thread's instance, if any, or NULL. 29 static RenderThreadInfoMagma* get(); 30 31 // Decoder state. 32 // TODO(b/271593488): Support dynamic detection of host device. 33 std::unique_ptr<gfxstream::magma::Decoder> mMagmaDec; 34 }; 35