Hash :
d3aad0f4
Author :
Date :
2020-02-20T08:59:58
Vulkan: Remove command graph size overlay widget. No longer applicable without the command graph. Bug: angleproject:4029 Change-Id: If75e3aca56eb18567074e14ceb23b3fd7a0afb3d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2065919 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_overlay_widgets.py using data from overlay_widgets.json.
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Overlay_autogen.cpp:
// Autogenerated overlay widget declarations.
#include "libANGLE/Overlay.h"
#include "libANGLE/OverlayWidgets.h"
#include "libANGLE/Overlay_font_autogen.h"
#include "libANGLE/renderer/driver_utils.h"
namespace gl
{
using namespace overlay;
namespace
{
int GetFontSize(int fontSize, bool largeFont)
{
if (largeFont && fontSize > 0)
{
return fontSize - 1;
}
return fontSize;
}
} // anonymous namespace
void Overlay::initOverlayWidgets()
{
const bool kLargeFont = rx::IsAndroid();
{
PerSecond *widget = new PerSecond;
{
const int32_t fontSize = GetFontSize(kFontLayerMedium, kLargeFont);
const int32_t offsetX = 10;
const int32_t offsetY = 10;
const int32_t width = 12 * kFontGlyphWidths[fontSize];
const int32_t height = kFontGlyphHeights[fontSize];
widget->type = WidgetType::PerSecond;
widget->fontSize = fontSize;
widget->coords[0] = offsetX;
widget->coords[1] = offsetY;
widget->coords[2] = offsetX + width;
widget->coords[3] = offsetY + height;
widget->color[0] = 0.498039215686;
widget->color[1] = 0.749019607843;
widget->color[2] = 1.0;
widget->color[3] = 1.0;
}
mState.mOverlayWidgets[WidgetId::FPS].reset(widget);
}
{
Text *widget = new Text;
{
const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
const int32_t offsetX = 10;
const int32_t offsetY = -10;
const int32_t width = 150 * kFontGlyphWidths[fontSize];
const int32_t height = kFontGlyphHeights[fontSize];
widget->type = WidgetType::Text;
widget->fontSize = fontSize;
widget->coords[0] = offsetX;
widget->coords[1] = offsetY - height;
widget->coords[2] = offsetX + width;
widget->coords[3] = offsetY;
widget->color[0] = 1.0;
widget->color[1] = 0.0;
widget->color[2] = 0.0;
widget->color[3] = 1.0;
}
mState.mOverlayWidgets[WidgetId::VulkanLastValidationMessage].reset(widget);
}
{
Count *widget = new Count;
{
const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
const int32_t offsetX = 10;
const int32_t offsetY =
mState.mOverlayWidgets[WidgetId::VulkanLastValidationMessage]->coords[1];
const int32_t width = 25 * kFontGlyphWidths[fontSize];
const int32_t height = kFontGlyphHeights[fontSize];
widget->type = WidgetType::Count;
widget->fontSize = fontSize;
widget->coords[0] = offsetX;
widget->coords[1] = offsetY - height;
widget->coords[2] = offsetX + width;
widget->coords[3] = offsetY;
widget->color[0] = 1.0;
widget->color[1] = 0.0;
widget->color[2] = 0.0;
widget->color[3] = 1.0;
}
mState.mOverlayWidgets[WidgetId::VulkanValidationMessageCount].reset(widget);
}
{
RunningGraph *widget = new RunningGraph(60);
{
const int32_t fontSize = GetFontSize(0, kLargeFont);
const int32_t offsetX = 10;
const int32_t offsetY = 100;
const int32_t width = 5 * static_cast<uint32_t>(widget->runningValues.size());
const int32_t height = 100;
widget->type = WidgetType::RunningGraph;
widget->fontSize = fontSize;
widget->coords[0] = offsetX;
widget->coords[1] = offsetY;
widget->coords[2] = offsetX + width;
widget->coords[3] = offsetY + height;
widget->color[0] = 0.294117647059;
widget->color[1] = 0.78431372549;
widget->color[2] = 0.0;
widget->color[3] = 0.78431372549;
}
mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount].reset(widget);
{
const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
const int32_t offsetX =
mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount]->coords[0];
const int32_t offsetY =
mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount]->coords[1];
const int32_t width = 40 * kFontGlyphWidths[fontSize];
const int32_t height = kFontGlyphHeights[fontSize];
widget->description.type = WidgetType::Text;
widget->description.fontSize = fontSize;
widget->description.coords[0] = offsetX;
widget->description.coords[1] = std::max(offsetY - height, 1);
widget->description.coords[2] = offsetX + width;
widget->description.coords[3] = offsetY;
widget->description.color[0] = 0.294117647059;
widget->description.color[1] = 0.78431372549;
widget->description.color[2] = 0.0;
widget->description.color[3] = 1.0;
}
}
{
RunningHistogram *widget = new RunningHistogram(50);
{
const int32_t fontSize = GetFontSize(0, kLargeFont);
const int32_t offsetX = -50;
const int32_t offsetY = 100;
const int32_t width = 6 * static_cast<uint32_t>(widget->runningValues.size());
const int32_t height = 100;
widget->type = WidgetType::RunningHistogram;
widget->fontSize = fontSize;
widget->coords[0] = offsetX - width;
widget->coords[1] = offsetY;
widget->coords[2] = offsetX;
widget->coords[3] = offsetY + height;
widget->color[0] = 1.0;
widget->color[1] = 0.78431372549;
widget->color[2] = 0.294117647059;
widget->color[3] = 0.78431372549;
}
mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste].reset(widget);
{
const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
const int32_t offsetX =
mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste]->coords[0];
const int32_t offsetY =
mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste]->coords[1];
const int32_t width = 40 * kFontGlyphWidths[fontSize];
const int32_t height = kFontGlyphHeights[fontSize];
widget->description.type = WidgetType::Text;
widget->description.fontSize = fontSize;
widget->description.coords[0] = offsetX;
widget->description.coords[1] = std::max(offsetY - height, 1);
widget->description.coords[2] = std::min(offsetX + width, -1);
widget->description.coords[3] = offsetY;
widget->description.color[0] = 1.0;
widget->description.color[1] = 0.78431372549;
widget->description.color[2] = 0.294117647059;
widget->description.color[3] = 1.0;
}
}
}
} // namespace gl