Lines Matching refs:pApp

44 Renderer *getRenderer(android_app *pApp) {  in getRenderer()  argument
45 return (pApp->userData) ? reinterpret_cast<Renderer *>(pApp->userData) : nullptr; in getRenderer()
64 FrameStats drawFrames(int count, android_app *pApp, int &events, android_poll_source *&pSource, in drawFrames() argument
73 for (int iter = -1; iter < count && !pApp->destroyRequested;) { in drawFrames()
84 pSource->process(pApp, pSource); in drawFrames()
86 if (pApp->userData) { in drawFrames()
93 jlong spinTime = getRenderer(pApp)->render(); in drawFrames()
94 getRenderer(pApp)->reportActualWorkDuration(spinTime); in drawFrames()
104 getRenderer(pApp)->addResult(testName + "_durations", serializeValues(durations)); in drawFrames()
105 getRenderer(pApp)->addResult(testName + "_intervals", serializeValues(intervals)); in drawFrames()
108 return getRenderer(pApp)->getFrameStats(durations, intervals, testName); in drawFrames()
111 FrameStats drawFramesWithTarget(int64_t targetDuration, int &events, android_app *pApp, in drawFramesWithTarget() argument
113 getRenderer(pApp)->updateTargetWorkDuration(targetDuration); in drawFramesWithTarget()
114 return drawFrames(kSamples, pApp, events, pSource, testName); in drawFramesWithTarget()
119 double calibrate(int &events, android_app *pApp, android_poll_source *&pSource) { in calibrate() argument
121 getRenderer(pApp)->setNumHeads(1); in calibrate()
127 calibration[0] = drawFrames(kCalibrationSamples, pApp, events, pSource); in calibrate()
128 getRenderer(pApp)->setNumHeads(200); in calibrate()
129 calibration[1] = drawFrames(kCalibrationSamples, pApp, events, pSource); in calibrate()
138 getRenderer(pApp)->addResult("goal_duration", std::to_string(static_cast<int>(target))); in calibrate()
139 getRenderer(pApp)->addResult("heads_count", std::to_string(heads)); in calibrate()
141 getRenderer(pApp)->setNumHeads(std::max(heads, 1)); in calibrate()
150 void handle_cmd(android_app *pApp, int32_t cmd) { in handle_cmd() argument
153 pApp->userData = new Renderer(pApp); in handle_cmd()
160 if (pApp->userData) { in handle_cmd()
161 auto *pRenderer = getRenderer(pApp); in handle_cmd()
170 void android_main(struct android_app *pApp) { in android_main() argument
174 pApp->onAppCmd = handle_cmd; in android_main()
177 manager.setApp(pApp); in android_main()
183 drawFrames(1, pApp, events, pSource); in android_main()
185 bool supported = getRenderer(pApp)->getAdpfSupported(); in android_main()
188 JNIManager::sendResultsToJava(getRenderer(pApp)->getResults()); in android_main()
193 getRenderer(pApp)->setNumHeads(100); in android_main()
195 drawFrames(kCalibrationSamples, pApp, events, pSource); in android_main()
197 FrameStats initialStats = drawFrames(kSamples, pApp, events, pSource); in android_main()
201 getRenderer(pApp)->startHintSession(tids, 6 * initialStats.medianWorkDuration); in android_main()
202 if (!getRenderer(pApp)->isHintSessionRunning()) { in android_main()
203 Utility::setFailure("Session failed to start!", getRenderer(pApp)); in android_main()
207 drawFrames(kCalibrationSamples / 2, pApp, events, pSource); in android_main()
209 double calibratedTarget = calibrate(events, pApp, pSource); in android_main()
215 FrameStats baselineStats = drawFrames(kSamples, pApp, events, pSource, "baseline"); in android_main()
220 getRenderer(pApp)->addResult("calibration_accuracy", std::to_string(calibrationAccuracy)); in android_main()
225 getRenderer(pApp)->setBaselineMedian(baselineStats.medianWorkDuration); in android_main()
232 [&]() { drawFramesWithTarget(heavyTarget, events, pApp, pSource, "heavy_load"); }); in android_main()
237 [&]() { drawFramesWithTarget(lightTarget, events, pApp, pSource, "light_load"); }); in android_main()
242 drawFramesWithTarget(lightTarget, events, pApp, pSource, "transition_load_1"); in android_main()
243 drawFramesWithTarget(heavyTarget, events, pApp, pSource, "transition_load_2"); in android_main()
244 drawFramesWithTarget(lightTarget, events, pApp, pSource, "transition_load_3"); in android_main()
254 JNIManager::sendResultsToJava(getRenderer(pApp)->getResults()); in android_main()