1 // Copyright 2020 The Dawn Authors 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 #include "dawn_platform/DawnPlatform.h" 16 #include "dawn_platform/WorkerThread.h" 17 18 #include "common/Assert.h" 19 20 namespace dawn_platform { 21 22 CachingInterface::CachingInterface() = default; 23 24 CachingInterface::~CachingInterface() = default; 25 26 Platform::Platform() = default; 27 28 Platform::~Platform() = default; 29 GetTraceCategoryEnabledFlag(TraceCategory category)30 const unsigned char* Platform::GetTraceCategoryEnabledFlag(TraceCategory category) { 31 static unsigned char disabled = 0; 32 return &disabled; 33 } 34 MonotonicallyIncreasingTime()35 double Platform::MonotonicallyIncreasingTime() { 36 return 0; 37 } 38 AddTraceEvent(char phase,const unsigned char * categoryGroupEnabled,const char * name,uint64_t id,double timestamp,int numArgs,const char ** argNames,const unsigned char * argTypes,const uint64_t * argValues,unsigned char flags)39 uint64_t Platform::AddTraceEvent(char phase, 40 const unsigned char* categoryGroupEnabled, 41 const char* name, 42 uint64_t id, 43 double timestamp, 44 int numArgs, 45 const char** argNames, 46 const unsigned char* argTypes, 47 const uint64_t* argValues, 48 unsigned char flags) { 49 // AddTraceEvent cannot be called if events are disabled. 50 ASSERT(false); 51 return 0; 52 } 53 GetCachingInterface(const void * fingerprint,size_t fingerprintSize)54 dawn_platform::CachingInterface* Platform::GetCachingInterface(const void* fingerprint, 55 size_t fingerprintSize) { 56 return nullptr; 57 } 58 CreateWorkerTaskPool()59 std::unique_ptr<dawn_platform::WorkerTaskPool> Platform::CreateWorkerTaskPool() { 60 return std::make_unique<AsyncWorkerThreadPool>(); 61 } 62 63 } // namespace dawn_platform 64