1 // Copyright 2020 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 express 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 "aemu/base/Compiler.h" 18 19 #include <memory> 20 #include <string> 21 #include <vector> 22 23 namespace android { 24 namespace base { 25 class GLObjectCounter { 26 DISALLOW_COPY_ASSIGN_AND_MOVE(GLObjectCounter); 27 28 public: 29 GLObjectCounter(); 30 static GLObjectCounter* get(); 31 void incCount(size_t type); 32 void decCount(size_t type); 33 std::vector<size_t> getCounts(); 34 std::string printUsage(); 35 36 private: 37 class Impl; 38 std::unique_ptr<Impl> mImpl; 39 }; 40 } // namespace base 41 } // namespace android 42