xref: /aosp_15_r20/external/angle/src/libANGLE/Overlay_autogen.cpp (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by gen_overlay_widgets.py using data from overlay_widgets.json.
3 //
4 // Copyright 2019 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // Overlay_autogen.cpp:
9 //   Autogenerated overlay widget declarations.
10 
11 #include "libANGLE/Overlay.h"
12 #include "libANGLE/OverlayWidgets.h"
13 #include "libANGLE/Overlay_font_autogen.h"
14 #include "libANGLE/renderer/driver_utils.h"
15 
16 namespace gl
17 {
18 using namespace overlay;
19 
20 namespace
21 {
GetFontSize(int fontSize,bool largeFont)22 int GetFontSize(int fontSize, bool largeFont)
23 {
24     if (largeFont && fontSize > 0)
25     {
26         return fontSize - 1;
27     }
28     return fontSize;
29 }
30 }  // anonymous namespace
31 
initOverlayWidgets()32 void Overlay::initOverlayWidgets()
33 {
34     const bool kLargeFont = rx::IsAndroid();
35 
36     {
37         PerSecond *widget = new PerSecond;
38         {
39             const int32_t fontSize = GetFontSize(kFontMipLarge, kLargeFont);
40             const int32_t offsetX  = 10;
41             const int32_t offsetY  = 10;
42             const int32_t width    = 12 * (kFontGlyphWidth >> fontSize);
43             const int32_t height   = (kFontGlyphHeight >> fontSize);
44 
45             widget->type          = WidgetType::PerSecond;
46             widget->fontSize      = fontSize;
47             widget->coords[0]     = offsetX;
48             widget->coords[1]     = offsetY;
49             widget->coords[2]     = offsetX + width;
50             widget->coords[3]     = offsetY + height;
51             widget->color[0]      = 0.4980392156862745f;
52             widget->color[1]      = 0.7490196078431373f;
53             widget->color[2]      = 1.0f;
54             widget->color[3]      = 1.0f;
55             widget->matchToWidget = nullptr;
56         }
57         mState.mOverlayWidgets[WidgetId::FPS].reset(widget);
58     }
59 
60     {
61         Text *widget = new Text;
62         {
63             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
64             const int32_t offsetX  = 10;
65             const int32_t offsetY  = -10;
66             const int32_t width    = 150 * (kFontGlyphWidth >> fontSize);
67             const int32_t height   = (kFontGlyphHeight >> fontSize);
68 
69             widget->type          = WidgetType::Text;
70             widget->fontSize      = fontSize;
71             widget->coords[0]     = offsetX;
72             widget->coords[1]     = offsetY - height;
73             widget->coords[2]     = offsetX + width;
74             widget->coords[3]     = offsetY;
75             widget->color[0]      = 1.0f;
76             widget->color[1]      = 0.0f;
77             widget->color[2]      = 0.0f;
78             widget->color[3]      = 1.0f;
79             widget->matchToWidget = nullptr;
80         }
81         mState.mOverlayWidgets[WidgetId::VulkanLastValidationMessage].reset(widget);
82     }
83 
84     {
85         Count *widget = new Count;
86         {
87             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
88             const int32_t offsetX  = 10;
89             const int32_t offsetY =
90                 mState.mOverlayWidgets[WidgetId::VulkanLastValidationMessage]->coords[1];
91             const int32_t width  = 25 * (kFontGlyphWidth >> fontSize);
92             const int32_t height = (kFontGlyphHeight >> fontSize);
93 
94             widget->type          = WidgetType::Count;
95             widget->fontSize      = fontSize;
96             widget->coords[0]     = offsetX;
97             widget->coords[1]     = offsetY - height;
98             widget->coords[2]     = offsetX + width;
99             widget->coords[3]     = offsetY;
100             widget->color[0]      = 1.0f;
101             widget->color[1]      = 0.0f;
102             widget->color[2]      = 0.0f;
103             widget->color[3]      = 1.0f;
104             widget->matchToWidget = nullptr;
105         }
106         mState.mOverlayWidgets[WidgetId::VulkanValidationMessageCount].reset(widget);
107     }
108 
109     {
110         RunningGraph *widget = new RunningGraph(60);
111         {
112             const int32_t fontSize = GetFontSize(0, kLargeFont);
113             const int32_t offsetX  = 10;
114             const int32_t offsetY  = 100;
115             const int32_t width    = 5 * static_cast<uint32_t>(widget->runningValues.size());
116             const int32_t height   = 100;
117 
118             widget->type          = WidgetType::RunningGraph;
119             widget->fontSize      = fontSize;
120             widget->coords[0]     = offsetX;
121             widget->coords[1]     = offsetY;
122             widget->coords[2]     = offsetX + width;
123             widget->coords[3]     = offsetY + height;
124             widget->color[0]      = 0.29411764705882354f;
125             widget->color[1]      = 0.7843137254901961f;
126             widget->color[2]      = 0.0f;
127             widget->color[3]      = 0.7843137254901961f;
128             widget->matchToWidget = nullptr;
129         }
130         mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount].reset(widget);
131         {
132             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
133             const int32_t offsetX =
134                 mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount]->coords[0];
135             const int32_t offsetY =
136                 mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount]->coords[1];
137             const int32_t width  = 40 * (kFontGlyphWidth >> fontSize);
138             const int32_t height = (kFontGlyphHeight >> fontSize);
139 
140             widget->description.type          = WidgetType::Text;
141             widget->description.fontSize      = fontSize;
142             widget->description.coords[0]     = offsetX;
143             widget->description.coords[1]     = std::max(offsetY - height, 1);
144             widget->description.coords[2]     = offsetX + width;
145             widget->description.coords[3]     = offsetY;
146             widget->description.color[0]      = 0.29411764705882354f;
147             widget->description.color[1]      = 0.7843137254901961f;
148             widget->description.color[2]      = 0.0f;
149             widget->description.color[3]      = 1.0f;
150             widget->description.matchToWidget = nullptr;
151         }
152     }
153 
154     {
155         RunningHistogram *widget = new RunningHistogram(50);
156         {
157             const int32_t fontSize = GetFontSize(0, kLargeFont);
158             const int32_t offsetX  = -50;
159             const int32_t offsetY  = 100;
160             const int32_t width    = 6 * static_cast<uint32_t>(widget->runningValues.size());
161             const int32_t height   = 100;
162 
163             widget->type          = WidgetType::RunningHistogram;
164             widget->fontSize      = fontSize;
165             widget->coords[0]     = offsetX - width;
166             widget->coords[1]     = offsetY;
167             widget->coords[2]     = offsetX;
168             widget->coords[3]     = offsetY + height;
169             widget->color[0]      = 1.0f;
170             widget->color[1]      = 0.7843137254901961f;
171             widget->color[2]      = 0.29411764705882354f;
172             widget->color[3]      = 0.7843137254901961f;
173             widget->matchToWidget = nullptr;
174         }
175         mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste].reset(widget);
176         {
177             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
178             const int32_t offsetX =
179                 mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste]->coords[0];
180             const int32_t offsetY =
181                 mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste]->coords[1];
182             const int32_t width  = 40 * (kFontGlyphWidth >> fontSize);
183             const int32_t height = (kFontGlyphHeight >> fontSize);
184 
185             widget->description.type          = WidgetType::Text;
186             widget->description.fontSize      = fontSize;
187             widget->description.coords[0]     = offsetX;
188             widget->description.coords[1]     = std::max(offsetY - height, 1);
189             widget->description.coords[2]     = std::min(offsetX + width, -1);
190             widget->description.coords[3]     = offsetY;
191             widget->description.color[0]      = 1.0f;
192             widget->description.color[1]      = 0.7843137254901961f;
193             widget->description.color[2]      = 0.29411764705882354f;
194             widget->description.color[3]      = 1.0f;
195             widget->description.matchToWidget = nullptr;
196         }
197     }
198 
199     {
200         RunningGraph *widget = new RunningGraph(60);
201         {
202             const int32_t fontSize = GetFontSize(0, kLargeFont);
203             const int32_t offsetX  = 10;
204             const int32_t offsetY  = 220;
205             const int32_t width    = 5 * static_cast<uint32_t>(widget->runningValues.size());
206             const int32_t height   = 100;
207 
208             widget->type          = WidgetType::RunningGraph;
209             widget->fontSize      = fontSize;
210             widget->coords[0]     = offsetX;
211             widget->coords[1]     = offsetY;
212             widget->coords[2]     = offsetX + width;
213             widget->coords[3]     = offsetY + height;
214             widget->color[0]      = 0.29411764705882354f;
215             widget->color[1]      = 0.7843137254901961f;
216             widget->color[2]      = 0.0f;
217             widget->color[3]      = 0.7843137254901961f;
218             widget->matchToWidget = nullptr;
219         }
220         mState.mOverlayWidgets[WidgetId::VulkanWriteDescriptorSetCount].reset(widget);
221         {
222             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
223             const int32_t offsetX =
224                 mState.mOverlayWidgets[WidgetId::VulkanWriteDescriptorSetCount]->coords[0];
225             const int32_t offsetY =
226                 mState.mOverlayWidgets[WidgetId::VulkanWriteDescriptorSetCount]->coords[1];
227             const int32_t width  = 40 * (kFontGlyphWidth >> fontSize);
228             const int32_t height = (kFontGlyphHeight >> fontSize);
229 
230             widget->description.type          = WidgetType::Text;
231             widget->description.fontSize      = fontSize;
232             widget->description.coords[0]     = offsetX;
233             widget->description.coords[1]     = std::max(offsetY - height, 1);
234             widget->description.coords[2]     = offsetX + width;
235             widget->description.coords[3]     = offsetY;
236             widget->description.color[0]      = 0.29411764705882354f;
237             widget->description.color[1]      = 0.7843137254901961f;
238             widget->description.color[2]      = 0.0f;
239             widget->description.color[3]      = 1.0f;
240             widget->description.matchToWidget = nullptr;
241         }
242     }
243 
244     {
245         RunningGraph *widget = new RunningGraph(60);
246         {
247             const int32_t fontSize = GetFontSize(0, kLargeFont);
248             const int32_t offsetX  = 0;
249             const int32_t offsetY  = 250;
250             const int32_t width    = 6 * static_cast<uint32_t>(widget->runningValues.size());
251             const int32_t height   = 100;
252 
253             widget->type          = WidgetType::RunningGraph;
254             widget->fontSize      = fontSize;
255             widget->coords[0]     = offsetX;
256             widget->coords[1]     = offsetY;
257             widget->coords[2]     = offsetX + width;
258             widget->coords[3]     = offsetY + height;
259             widget->color[0]      = 1.0f;
260             widget->color[1]      = 0.0f;
261             widget->color[2]      = 0.29411764705882354f;
262             widget->color[3]      = 0.7843137254901961f;
263             widget->matchToWidget = nullptr;
264         }
265         mState.mOverlayWidgets[WidgetId::VulkanDescriptorSetAllocations].reset(widget);
266         {
267             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
268             const int32_t offsetX =
269                 mState.mOverlayWidgets[WidgetId::VulkanDescriptorSetAllocations]->coords[0];
270             const int32_t offsetY =
271                 mState.mOverlayWidgets[WidgetId::VulkanDescriptorSetAllocations]->coords[1];
272             const int32_t width  = 40 * (kFontGlyphWidth >> fontSize);
273             const int32_t height = (kFontGlyphHeight >> fontSize);
274 
275             widget->description.type          = WidgetType::Text;
276             widget->description.fontSize      = fontSize;
277             widget->description.coords[0]     = offsetX;
278             widget->description.coords[1]     = std::max(offsetY - height, 1);
279             widget->description.coords[2]     = offsetX + width;
280             widget->description.coords[3]     = offsetY;
281             widget->description.color[0]      = 1.0f;
282             widget->description.color[1]      = 0.0f;
283             widget->description.color[2]      = 0.29411764705882354f;
284             widget->description.color[3]      = 1.0f;
285             widget->description.matchToWidget = nullptr;
286         }
287     }
288 
289     {
290         RunningGraph *widget = new RunningGraph(60);
291         {
292             const int32_t fontSize = GetFontSize(0, kLargeFont);
293             const int32_t offsetX  = -50;
294             const int32_t offsetY  = 360;
295             const int32_t width    = 6 * static_cast<uint32_t>(widget->runningValues.size());
296             const int32_t height   = 100;
297 
298             widget->type          = WidgetType::RunningGraph;
299             widget->fontSize      = fontSize;
300             widget->coords[0]     = offsetX - width;
301             widget->coords[1]     = offsetY;
302             widget->coords[2]     = offsetX;
303             widget->coords[3]     = offsetY + height;
304             widget->color[0]      = 1.0f;
305             widget->color[1]      = 0.0f;
306             widget->color[2]      = 0.29411764705882354f;
307             widget->color[3]      = 0.7843137254901961f;
308             widget->matchToWidget = nullptr;
309         }
310         mState.mOverlayWidgets[WidgetId::VulkanShaderResourceDSHitRate].reset(widget);
311         {
312             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
313             const int32_t offsetX =
314                 mState.mOverlayWidgets[WidgetId::VulkanShaderResourceDSHitRate]->coords[0];
315             const int32_t offsetY =
316                 mState.mOverlayWidgets[WidgetId::VulkanShaderResourceDSHitRate]->coords[1];
317             const int32_t width  = 40 * (kFontGlyphWidth >> fontSize);
318             const int32_t height = (kFontGlyphHeight >> fontSize);
319 
320             widget->description.type          = WidgetType::Text;
321             widget->description.fontSize      = fontSize;
322             widget->description.coords[0]     = offsetX;
323             widget->description.coords[1]     = std::max(offsetY - height, 1);
324             widget->description.coords[2]     = std::min(offsetX + width, -1);
325             widget->description.coords[3]     = offsetY;
326             widget->description.color[0]      = 1.0f;
327             widget->description.color[1]      = 0.0f;
328             widget->description.color[2]      = 0.29411764705882354f;
329             widget->description.color[3]      = 1.0f;
330             widget->description.matchToWidget = nullptr;
331         }
332     }
333 
334     {
335         RunningGraph *widget = new RunningGraph(120);
336         {
337             const int32_t fontSize = GetFontSize(0, kLargeFont);
338             const int32_t offsetX  = -50;
339             const int32_t offsetY  = -50;
340             const int32_t width    = 5 * static_cast<uint32_t>(widget->runningValues.size());
341             const int32_t height   = 100;
342 
343             widget->type          = WidgetType::RunningGraph;
344             widget->fontSize      = fontSize;
345             widget->coords[0]     = offsetX - width;
346             widget->coords[1]     = offsetY - height;
347             widget->coords[2]     = offsetX;
348             widget->coords[3]     = offsetY;
349             widget->color[0]      = 0.0f;
350             widget->color[1]      = 0.7843137254901961f;
351             widget->color[2]      = 0.29411764705882354f;
352             widget->color[3]      = 0.7843137254901961f;
353             widget->matchToWidget = nullptr;
354         }
355         mState.mOverlayWidgets[WidgetId::VulkanDynamicBufferAllocations].reset(widget);
356         {
357             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
358             const int32_t offsetX =
359                 mState.mOverlayWidgets[WidgetId::VulkanDynamicBufferAllocations]->coords[2];
360             const int32_t offsetY =
361                 mState.mOverlayWidgets[WidgetId::VulkanDynamicBufferAllocations]->coords[1];
362             const int32_t width  = 40 * (kFontGlyphWidth >> fontSize);
363             const int32_t height = (kFontGlyphHeight >> fontSize);
364 
365             widget->description.type          = WidgetType::Text;
366             widget->description.fontSize      = fontSize;
367             widget->description.coords[0]     = offsetX - width;
368             widget->description.coords[1]     = offsetY - height;
369             widget->description.coords[2]     = offsetX;
370             widget->description.coords[3]     = offsetY;
371             widget->description.color[0]      = 0.0f;
372             widget->description.color[1]      = 0.7843137254901961f;
373             widget->description.color[2]      = 0.29411764705882354f;
374             widget->description.color[3]      = 1.0f;
375             widget->description.matchToWidget = nullptr;
376         }
377     }
378 
379     {
380         RunningGraph *widget = new RunningGraph(60);
381         {
382             const int32_t fontSize = GetFontSize(0, kLargeFont);
383             const int32_t offsetX  = 0;
384             const int32_t offsetY  = 450;
385             const int32_t width    = 5 * static_cast<uint32_t>(widget->runningValues.size());
386             const int32_t height   = 100;
387 
388             widget->type          = WidgetType::RunningGraph;
389             widget->fontSize      = fontSize;
390             widget->coords[0]     = offsetX;
391             widget->coords[1]     = offsetY;
392             widget->coords[2]     = offsetX + width;
393             widget->coords[3]     = offsetY + height;
394             widget->color[0]      = 0.0f;
395             widget->color[1]      = 0.7843137254901961f;
396             widget->color[2]      = 0.7254901960784313f;
397             widget->color[3]      = 0.7843137254901961f;
398             widget->matchToWidget = nullptr;
399         }
400         mState.mOverlayWidgets[WidgetId::VulkanDescriptorCacheSize].reset(widget);
401         {
402             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
403             const int32_t offsetX =
404                 mState.mOverlayWidgets[WidgetId::VulkanDescriptorCacheSize]->coords[0];
405             const int32_t offsetY =
406                 mState.mOverlayWidgets[WidgetId::VulkanDescriptorCacheSize]->coords[1];
407             const int32_t width  = 90 * (kFontGlyphWidth >> fontSize);
408             const int32_t height = (kFontGlyphHeight >> fontSize);
409 
410             widget->description.type          = WidgetType::Text;
411             widget->description.fontSize      = fontSize;
412             widget->description.coords[0]     = offsetX;
413             widget->description.coords[1]     = std::max(offsetY - height, 1);
414             widget->description.coords[2]     = offsetX + width;
415             widget->description.coords[3]     = offsetY;
416             widget->description.color[0]      = 0.0f;
417             widget->description.color[1]      = 0.7843137254901961f;
418             widget->description.color[2]      = 0.29411764705882354f;
419             widget->description.color[3]      = 1.0f;
420             widget->description.matchToWidget = nullptr;
421         }
422     }
423 
424     {
425         RunningGraph *widget = new RunningGraph(60);
426         {
427             const int32_t fontSize = GetFontSize(0, kLargeFont);
428             const int32_t offsetX  = 0;
429             const int32_t offsetY  = 450;
430             const int32_t width    = 5 * static_cast<uint32_t>(widget->runningValues.size());
431             const int32_t height   = 100;
432 
433             widget->type          = WidgetType::RunningGraph;
434             widget->fontSize      = fontSize;
435             widget->coords[0]     = offsetX;
436             widget->coords[1]     = offsetY;
437             widget->coords[2]     = offsetX + width;
438             widget->coords[3]     = offsetY + height;
439             widget->color[0]      = 0.0f;
440             widget->color[1]      = 0.7843137254901961f;
441             widget->color[2]      = 0.29411764705882354f;
442             widget->color[3]      = 0.7843137254901961f;
443             widget->matchToWidget = nullptr;
444         }
445         mState.mOverlayWidgets[WidgetId::VulkanTextureDescriptorCacheSize].reset(widget);
446         {
447             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
448             const int32_t offsetX =
449                 mState.mOverlayWidgets[WidgetId::VulkanTextureDescriptorCacheSize]->coords[0];
450             const int32_t offsetY =
451                 mState.mOverlayWidgets[WidgetId::VulkanTextureDescriptorCacheSize]->coords[1];
452             const int32_t width  = 90 * (kFontGlyphWidth >> fontSize);
453             const int32_t height = (kFontGlyphHeight >> fontSize);
454 
455             widget->description.type          = WidgetType::Text;
456             widget->description.fontSize      = fontSize;
457             widget->description.coords[0]     = offsetX;
458             widget->description.coords[1]     = std::max(offsetY - height, 1);
459             widget->description.coords[2]     = offsetX + width;
460             widget->description.coords[3]     = offsetY;
461             widget->description.color[0]      = 0.0f;
462             widget->description.color[1]      = 0.7843137254901961f;
463             widget->description.color[2]      = 0.29411764705882354f;
464             widget->description.color[3]      = 1.0f;
465             widget->description.matchToWidget = nullptr;
466         }
467     }
468 
469     {
470         RunningGraph *widget = new RunningGraph(60);
471         {
472             const int32_t fontSize = GetFontSize(0, kLargeFont);
473             const int32_t offsetX  = 0;
474             const int32_t offsetY  = 450;
475             const int32_t width    = 5 * static_cast<uint32_t>(widget->runningValues.size());
476             const int32_t height   = 100;
477 
478             widget->type          = WidgetType::RunningGraph;
479             widget->fontSize      = fontSize;
480             widget->coords[0]     = offsetX;
481             widget->coords[1]     = offsetY;
482             widget->coords[2]     = offsetX + width;
483             widget->coords[3]     = offsetY + height;
484             widget->color[0]      = 0.0f;
485             widget->color[1]      = 0.7843137254901961f;
486             widget->color[2]      = 1.0f;
487             widget->color[3]      = 0.7843137254901961f;
488             widget->matchToWidget = nullptr;
489         }
490         mState.mOverlayWidgets[WidgetId::VulkanUniformDescriptorCacheSize].reset(widget);
491         {
492             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
493             const int32_t offsetX =
494                 mState.mOverlayWidgets[WidgetId::VulkanUniformDescriptorCacheSize]->coords[0];
495             const int32_t offsetY =
496                 mState.mOverlayWidgets[WidgetId::VulkanUniformDescriptorCacheSize]->coords[1];
497             const int32_t width  = 90 * (kFontGlyphWidth >> fontSize);
498             const int32_t height = (kFontGlyphHeight >> fontSize);
499 
500             widget->description.type          = WidgetType::Text;
501             widget->description.fontSize      = fontSize;
502             widget->description.coords[0]     = offsetX;
503             widget->description.coords[1]     = std::max(offsetY - height, 1);
504             widget->description.coords[2]     = offsetX + width;
505             widget->description.coords[3]     = offsetY;
506             widget->description.color[0]      = 0.0f;
507             widget->description.color[1]      = 0.7843137254901961f;
508             widget->description.color[2]      = 0.29411764705882354f;
509             widget->description.color[3]      = 1.0f;
510             widget->description.matchToWidget = nullptr;
511         }
512     }
513 
514     {
515         Count *widget = new Count;
516         {
517             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
518             const int32_t offsetX  = 10;
519             const int32_t offsetY  = 100;
520             const int32_t width    = 30 * (kFontGlyphWidth >> fontSize);
521             const int32_t height   = (kFontGlyphHeight >> fontSize);
522 
523             widget->type          = WidgetType::Count;
524             widget->fontSize      = fontSize;
525             widget->coords[0]     = offsetX;
526             widget->coords[1]     = offsetY;
527             widget->coords[2]     = offsetX + width;
528             widget->coords[3]     = offsetY + height;
529             widget->color[0]      = 1.0f;
530             widget->color[1]      = 1.0f;
531             widget->color[2]      = 1.0f;
532             widget->color[3]      = 1.0f;
533             widget->matchToWidget = nullptr;
534         }
535         mState.mOverlayWidgets[WidgetId::VulkanDescriptorCacheKeySize].reset(widget);
536     }
537 
538     {
539         RunningGraph *widget = new RunningGraph(60);
540         {
541             const int32_t fontSize = GetFontSize(0, kLargeFont);
542             const int32_t offsetX  = -50;
543             const int32_t offsetY  = 50;
544             const int32_t width    = 5 * static_cast<uint32_t>(widget->runningValues.size());
545             const int32_t height   = 100;
546 
547             widget->type          = WidgetType::RunningGraph;
548             widget->fontSize      = fontSize;
549             widget->coords[0]     = offsetX - width;
550             widget->coords[1]     = offsetY;
551             widget->coords[2]     = offsetX;
552             widget->coords[3]     = offsetY + height;
553             widget->color[0]      = 1.0f;
554             widget->color[1]      = 0.0f;
555             widget->color[2]      = 0.0f;
556             widget->color[3]      = 0.39215686274509803f;
557             widget->matchToWidget = nullptr;
558         }
559         mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions].reset(widget);
560         {
561             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
562             const int32_t offsetX =
563                 mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions]->coords[0];
564             const int32_t offsetY =
565                 mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions]->coords[1];
566             const int32_t width  = 45 * (kFontGlyphWidth >> fontSize);
567             const int32_t height = (kFontGlyphHeight >> fontSize);
568 
569             widget->description.type          = WidgetType::Text;
570             widget->description.fontSize      = fontSize;
571             widget->description.coords[0]     = offsetX;
572             widget->description.coords[1]     = std::max(offsetY - height, 1);
573             widget->description.coords[2]     = std::min(offsetX + width, -1);
574             widget->description.coords[3]     = offsetY;
575             widget->description.color[0]      = 0.7843137254901961f;
576             widget->description.color[1]      = 0.0f;
577             widget->description.color[2]      = 0.29411764705882354f;
578             widget->description.color[3]      = 1.0f;
579             widget->description.matchToWidget = nullptr;
580         }
581     }
582 
583     {
584         RunningGraph *widget = new RunningGraph(60);
585         {
586             const int32_t fontSize = GetFontSize(0, kLargeFont);
587             const int32_t offsetX =
588                 mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions]->coords[0];
589             const int32_t offsetY =
590                 mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions]->coords[1];
591             const int32_t width  = 5 * static_cast<uint32_t>(widget->runningValues.size());
592             const int32_t height = 100;
593 
594             widget->type      = WidgetType::RunningGraph;
595             widget->fontSize  = fontSize;
596             widget->coords[0] = offsetX;
597             widget->coords[1] = offsetY;
598             widget->coords[2] = std::min(offsetX + width, -1);
599             widget->coords[3] = offsetY + height;
600             widget->color[0]  = 0.0f;
601             widget->color[1]  = 1.0f;
602             widget->color[2]  = 0.0f;
603             widget->color[3]  = 0.7843137254901961f;
604             widget->matchToWidget =
605                 mState.mOverlayWidgets[WidgetId::VulkanAttemptedSubmissions].get();
606         }
607         mState.mOverlayWidgets[WidgetId::VulkanActualSubmissions].reset(widget);
608         {
609             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
610             const int32_t offsetX =
611                 mState.mOverlayWidgets[WidgetId::VulkanActualSubmissions]->coords[0];
612             const int32_t offsetY =
613                 mState.mOverlayWidgets[WidgetId::VulkanActualSubmissions]->coords[3];
614             const int32_t width  = 45 * (kFontGlyphWidth >> fontSize);
615             const int32_t height = (kFontGlyphHeight >> fontSize);
616 
617             widget->description.type          = WidgetType::Text;
618             widget->description.fontSize      = fontSize;
619             widget->description.coords[0]     = offsetX;
620             widget->description.coords[1]     = offsetY;
621             widget->description.coords[2]     = std::min(offsetX + width, -1);
622             widget->description.coords[3]     = offsetY + height;
623             widget->description.color[0]      = 0.0f;
624             widget->description.color[1]      = 0.7843137254901961f;
625             widget->description.color[2]      = 0.29411764705882354f;
626             widget->description.color[3]      = 1.0f;
627             widget->description.matchToWidget = nullptr;
628         }
629     }
630 
631     {
632         RunningGraph *widget = new RunningGraph(60);
633         {
634             const int32_t fontSize = GetFontSize(0, kLargeFont);
635             const int32_t offsetX  = -50;
636             const int32_t offsetY  = -50;
637             const int32_t width    = 5 * static_cast<uint32_t>(widget->runningValues.size());
638             const int32_t height   = 100;
639 
640             widget->type          = WidgetType::RunningGraph;
641             widget->fontSize      = fontSize;
642             widget->coords[0]     = offsetX - width;
643             widget->coords[1]     = offsetY - height;
644             widget->coords[2]     = offsetX;
645             widget->coords[3]     = offsetY;
646             widget->color[0]      = 0.0f;
647             widget->color[1]      = 1.0f;
648             widget->color[2]      = 0.0f;
649             widget->color[3]      = 0.39215686274509803f;
650             widget->matchToWidget = nullptr;
651         }
652         mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups].reset(widget);
653         {
654             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
655             const int32_t offsetX =
656                 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups]->coords[0];
657             const int32_t offsetY =
658                 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups]->coords[1];
659             const int32_t width  = 45 * (kFontGlyphWidth >> fontSize);
660             const int32_t height = (kFontGlyphHeight >> fontSize);
661 
662             widget->description.type          = WidgetType::Text;
663             widget->description.fontSize      = fontSize;
664             widget->description.coords[0]     = offsetX;
665             widget->description.coords[1]     = offsetY - height;
666             widget->description.coords[2]     = std::min(offsetX + width, -1);
667             widget->description.coords[3]     = offsetY;
668             widget->description.color[0]      = 0.0f;
669             widget->description.color[1]      = 0.7843137254901961f;
670             widget->description.color[2]      = 0.29411764705882354f;
671             widget->description.color[3]      = 1.0f;
672             widget->description.matchToWidget = nullptr;
673         }
674     }
675 
676     {
677         RunningGraph *widget = new RunningGraph(60);
678         {
679             const int32_t fontSize = GetFontSize(0, kLargeFont);
680             const int32_t offsetX =
681                 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups]->coords[0];
682             const int32_t offsetY =
683                 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups]->coords[1];
684             const int32_t width  = 5 * static_cast<uint32_t>(widget->runningValues.size());
685             const int32_t height = 100;
686 
687             widget->type      = WidgetType::RunningGraph;
688             widget->fontSize  = fontSize;
689             widget->coords[0] = offsetX;
690             widget->coords[1] = offsetY;
691             widget->coords[2] = std::min(offsetX + width, -1);
692             widget->coords[3] = std::min(offsetY + height, -1);
693             widget->color[0]  = 1.0f;
694             widget->color[1]  = 0.0f;
695             widget->color[2]  = 0.0f;
696             widget->color[3]  = 0.7843137254901961f;
697             widget->matchToWidget =
698                 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups].get();
699         }
700         mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheMisses].reset(widget);
701         {
702             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
703             const int32_t offsetX  = mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups]
704                                         ->getDescriptionWidget()
705                                         ->coords[0];
706             const int32_t offsetY = mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheLookups]
707                                         ->getDescriptionWidget()
708                                         ->coords[1];
709             const int32_t width  = 45 * (kFontGlyphWidth >> fontSize);
710             const int32_t height = (kFontGlyphHeight >> fontSize);
711 
712             widget->description.type          = WidgetType::Text;
713             widget->description.fontSize      = fontSize;
714             widget->description.coords[0]     = offsetX;
715             widget->description.coords[1]     = offsetY - height;
716             widget->description.coords[2]     = std::min(offsetX + width, -1);
717             widget->description.coords[3]     = offsetY;
718             widget->description.color[0]      = 0.7843137254901961f;
719             widget->description.color[1]      = 0.0f;
720             widget->description.color[2]      = 0.29411764705882354f;
721             widget->description.color[3]      = 1.0f;
722             widget->description.matchToWidget = nullptr;
723         }
724     }
725 
726     {
727         Count *widget = new Count;
728         {
729             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
730             const int32_t offsetX =
731                 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheMisses]->coords[0];
732             const int32_t offsetY =
733                 mState.mOverlayWidgets[WidgetId::VulkanPipelineCacheMisses]->coords[3];
734             const int32_t width  = 45 * (kFontGlyphWidth >> fontSize);
735             const int32_t height = (kFontGlyphHeight >> fontSize);
736 
737             widget->type          = WidgetType::Count;
738             widget->fontSize      = fontSize;
739             widget->coords[0]     = offsetX;
740             widget->coords[1]     = offsetY;
741             widget->coords[2]     = std::min(offsetX + width, -1);
742             widget->coords[3]     = std::min(offsetY + height, -1);
743             widget->color[0]      = 1.0f;
744             widget->color[1]      = 0.0f;
745             widget->color[2]      = 0.0f;
746             widget->color[3]      = 1.0f;
747             widget->matchToWidget = nullptr;
748         }
749         mState.mOverlayWidgets[WidgetId::VulkanTotalPipelineCacheMissTimeMs].reset(widget);
750     }
751 
752     {
753         Count *widget = new Count;
754         {
755             const int32_t fontSize = GetFontSize(kFontMipSmall, kLargeFont);
756             const int32_t offsetX =
757                 mState.mOverlayWidgets[WidgetId::VulkanTotalPipelineCacheMissTimeMs]->coords[0];
758             const int32_t offsetY =
759                 mState.mOverlayWidgets[WidgetId::VulkanTotalPipelineCacheMissTimeMs]->coords[3];
760             const int32_t width  = 45 * (kFontGlyphWidth >> fontSize);
761             const int32_t height = (kFontGlyphHeight >> fontSize);
762 
763             widget->type          = WidgetType::Count;
764             widget->fontSize      = fontSize;
765             widget->coords[0]     = offsetX;
766             widget->coords[1]     = offsetY;
767             widget->coords[2]     = std::min(offsetX + width, -1);
768             widget->coords[3]     = std::min(offsetY + height, -1);
769             widget->color[0]      = 0.0f;
770             widget->color[1]      = 1.0f;
771             widget->color[2]      = 0.0f;
772             widget->color[3]      = 1.0f;
773             widget->matchToWidget = nullptr;
774         }
775         mState.mOverlayWidgets[WidgetId::VulkanTotalPipelineCacheHitTimeMs].reset(widget);
776     }
777 }
778 
779 }  // namespace gl
780