void MemoryUsageSupport::memoryUsageByComponents(Vector<ComponentInfo>& components) { size_t size = SkGraphics::GetFontCacheUsed(); components.append(ComponentInfo("GlyphCache", size)); if (WebKit::Platform::current()->memoryAllocatorWasteInBytes(&size)) components.append(ComponentInfo("MallocWaste", size)); }
status_t OMX::listNodes(List<ComponentInfo> *list) { list->clear(); OMX_U32 index = 0; char componentName[256]; while (mMaster->enumerateComponents( componentName, sizeof(componentName), index) == OMX_ErrorNone) { list->push_back(ComponentInfo()); ComponentInfo &info = *--list->end(); info.mName = componentName; Vector<String8> roles; OMX_ERRORTYPE err = mMaster->getRolesOfComponent(componentName, &roles); if (err == OMX_ErrorNone) { for (OMX_U32 i = 0; i < roles.size(); ++i) { info.mRoles.push_back(roles[i]); } } ++index; } return OK; }
virtual status_t listNodes(List<ComponentInfo> *list) { list->clear(); Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); remote()->transact(LIST_NODES, data, &reply); int32_t n = reply.readInt32(); for (int32_t i = 0; i < n; ++i) { list->push_back(ComponentInfo()); ComponentInfo &info = *--list->end(); info.mName = reply.readString8(); int32_t numRoles = reply.readInt32(); for (int32_t j = 0; j < numRoles; ++j) { info.mRoles.push_back(reply.readString8()); } } return OK; }
void LevelLoader::SetupSpawnMaps() { // Actor spawn map mActorSpawnMap.emplace("Actor", &Actor::SpawnWithProperties); mActorSpawnMap.emplace("KillVolume", &KillVolume::SpawnWithProperties); mActorSpawnMap.emplace("Player", &Player::SpawnWithProperties); // Component spawn map mCompSpawnMap.emplace("BoxComponent", ComponentInfo(BoxComponent::StaticType(), &BoxComponent::CreateWithProperties)); mCompSpawnMap.emplace("CameraComponent", ComponentInfo(CameraComponent::StaticType(), &CameraComponent::CreateWithProperties)); mCompSpawnMap.emplace("CharacterMoveComponent", ComponentInfo(CharacterMoveComponent::StaticType(), &CharacterMoveComponent::CreateWithProperties)); mCompSpawnMap.emplace("MeshComponent", ComponentInfo(MeshComponent::StaticType(), &MeshComponent::CreateWithProperties)); mCompSpawnMap.emplace("PointLightComponent", ComponentInfo(PointLightComponent::StaticType(), &PointLightComponent::CreateWithProperties)); mCompSpawnMap.emplace("SkeletalMeshComponent", ComponentInfo(SkeletalMeshComponent::StaticType(), &SkeletalMeshComponent::CreateWithProperties)); }
void ModeHarnessPlugin::configure(jccl::ConfigElementPtr elt) { vprASSERT(elt->getID() == getElementType()); const unsigned int req_cfg_version(2); // Check for correct version of plugin configuration. if ( elt->getVersion() < req_cfg_version ) { std::stringstream msg; msg << "Configuration of ModeHarnessPlugin failed. Required config " << "element version is " << req_cfg_version << ", but element '" << elt->getName() << "' is version " << elt->getVersion(); throw PluginException(msg.str(), VRKIT_LOCATION); } const std::string component_path_prop("component_path"); const std::string default_component_prop("default_component"); const std::string component_prop("component"); const std::string plugin_prop("plugin"); const std::string signal_prop("signal"); const std::string active_component_prop("active_component"); // Set up two default search paths: // 1. Relative path to './plugins/mode' // 2. VRKIT_BASE_DIR/lib/vrkit/plugins/mode // // In all of the above cases, the 'debug' subdirectory is searched first if // this is a debug build (i.e., when VRKIT_DEBUG is defined and _DEBUG is // not). std::vector<std::string> component_path = plugin::getDefaultSearchPath("mode"); const unsigned int num_plugin_paths(elt->getNum(component_path_prop)); for ( unsigned int i = 0; i < num_plugin_paths; ++i ) { std::string dir = elt->getProperty<std::string>(component_path_prop, i); component_path.push_back(vpr::replaceEnvVars(dir)); } mDefaultComponentName = elt->getProperty<std::string>(default_component_prop); const unsigned int num_comps(elt->getNum(component_prop)); for ( unsigned int i = 0; i < num_comps; ++i ) { jccl::ConfigElementPtr comp_elt = elt->getProperty<jccl::ConfigElementPtr>(component_prop, i); mComponentInfo.push_back( ComponentInfo(comp_elt->getName(), comp_elt->getProperty<std::string>(plugin_prop)) ); } const unsigned int num_signals(elt->getNum(signal_prop)); for ( unsigned int i = 0; i < num_signals; ++i ) { jccl::ConfigElementPtr signal_elt = elt->getProperty<jccl::ConfigElementPtr>(signal_prop, i); mSignalDefs.push_back( SignalDef(signal_elt->getName(), signal_elt->getProperty<std::string>(active_component_prop)) ); } std::vector<vpr::LibraryPtr> modules = plugin::findModules(component_path); std::for_each(modules.begin(), modules.end(), boost::bind(&ModeHarnessPlugin::registerModule, this, _1)); }