1 /*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
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
16 #include "image/trace_memory_dump.h"
17
18 #include "impl_factory.h"
19
20 namespace OHOS {
21 namespace Rosen {
22 namespace Drawing {
TraceMemoryDump(const char * categoryKey,bool itemizeType)23 TraceMemoryDump::TraceMemoryDump(const char* categoryKey, bool itemizeType)
24 : impl_(ImplFactory::CreateTraceMemoryDumpImpl(categoryKey, itemizeType)) {}
25
DumpNumericValue(const char * dumpName,const char * valueName,const char * units,uint64_t value)26 void TraceMemoryDump::DumpNumericValue(const char* dumpName, const char* valueName, const char* units, uint64_t value)
27 {
28 impl_->DumpNumericValue(dumpName, valueName, units, value);
29 }
30
DumpStringValue(const char * dumpName,const char * valueName,const char * value)31 void TraceMemoryDump::DumpStringValue(const char* dumpName, const char* valueName, const char* value)
32 {
33 impl_->DumpStringValue(dumpName, valueName, value);
34 }
35
LogOutput(OHOS::Rosen::DfxString & log)36 void TraceMemoryDump::LogOutput(OHOS::Rosen::DfxString& log)
37 {
38 impl_->LogOutput(log);
39 }
40
LogTotals(OHOS::Rosen::DfxString & log)41 void TraceMemoryDump::LogTotals(OHOS::Rosen::DfxString& log)
42 {
43 impl_->LogTotals(log);
44 }
45
GetGpuMemorySizeInMB() const46 float TraceMemoryDump::GetGpuMemorySizeInMB() const
47 {
48 return impl_->GetGpuMemorySizeInMB();
49 }
50
GetGLMemorySize() const51 float TraceMemoryDump::GetGLMemorySize() const
52 {
53 return impl_->GetGLMemorySize();
54 }
55 }
56 }
57 }