+ {
+ if (stashBackbuffer) IORecordProgressBackbuffer(new_buffer,
+ (kProgressBarWidth * vc_uiscale)
+ * (kProgressBarHeight * vc_uiscale)
+ * sizeof(int),
+ vc_progress_white);
+ kfree(new_buffer, (kProgressBarWidth * vc_uiscale)
+ * (kProgressBarHeight * vc_uiscale) * sizeof(int));
+ }
+}
+
+static void
+internal_set_progressmeter(int new_value)
+{
+ int x1, x3;
+ int capRedraw;
+ // 1 rounded fill, 0 square end
+ int style = (0 == (2 & vc_progress_withmeter));
+
+ if ((new_value < 0) || (new_value > kProgressMeterMax)) return;
+
+ if (vc_progressmeter_enable)
+ {
+ vc_progressmeter_value = new_value;
+
+ capRedraw = (style ? (kProgressBarCapWidth * vc_uiscale) : 0);
+ x3 = (((kProgressBarWidth * vc_uiscale) - 2 * capRedraw) * vc_progressmeter_value) / kProgressMeterMax;
+ x3 += (2 * capRedraw);
+
+ if (x3 > vc_progressmeter_drawn)
+ {
+ x1 = capRedraw;
+ if (x1 > vc_progressmeter_drawn) x1 = vc_progressmeter_drawn;
+ vc_draw_progress_meter(kDataAlpha, vc_progressmeter_drawn - x1, x3, x3);
+ }
+ else
+ {
+ vc_draw_progress_meter(kDataAlpha, x3 - capRedraw, vc_progressmeter_drawn, x3);
+ }
+ vc_progressmeter_drawn = x3;
+ }
+}
+
+void
+vc_enable_progressmeter(int new_value)
+{
+ if (kProgressMeterKernel == vc_progressmeter_enable)
+ {
+ vc_progressmeter_hold = new_value;
+ }
+ else
+ {
+ internal_enable_progressmeter(new_value ? kProgressMeterUser : kProgressMeterOff);
+ }