mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
LibSoftGPU: Remove DeprecatedString usage
This commit is contained in:
parent
a8cb70c0c4
commit
5c1038e54f
1 changed files with 10 additions and 9 deletions
|
@ -12,6 +12,7 @@
|
||||||
#include <AK/NumericLimits.h>
|
#include <AK/NumericLimits.h>
|
||||||
#include <AK/SIMDExtras.h>
|
#include <AK/SIMDExtras.h>
|
||||||
#include <AK/SIMDMath.h>
|
#include <AK/SIMDMath.h>
|
||||||
|
#include <AK/String.h>
|
||||||
#include <LibCore/ElapsedTimer.h>
|
#include <LibCore/ElapsedTimer.h>
|
||||||
#include <LibGfx/Painter.h>
|
#include <LibGfx/Painter.h>
|
||||||
#include <LibGfx/Vector2.h>
|
#include <LibGfx/Vector2.h>
|
||||||
|
@ -1537,7 +1538,7 @@ void Device::blit_to_depth_buffer_at_raster_position(void const* input_data, GPU
|
||||||
void Device::draw_statistics_overlay(Gfx::Bitmap& target)
|
void Device::draw_statistics_overlay(Gfx::Bitmap& target)
|
||||||
{
|
{
|
||||||
static Core::ElapsedTimer timer;
|
static Core::ElapsedTimer timer;
|
||||||
static DeprecatedString debug_string;
|
static String debug_string;
|
||||||
static int frame_counter;
|
static int frame_counter;
|
||||||
|
|
||||||
frame_counter++;
|
frame_counter++;
|
||||||
|
@ -1554,20 +1555,20 @@ void Device::draw_statistics_overlay(Gfx::Bitmap& target)
|
||||||
int num_rendertarget_pixels = m_frame_buffer->rect().size().area();
|
int num_rendertarget_pixels = m_frame_buffer->rect().size().area();
|
||||||
|
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
builder.append(DeprecatedString::formatted("Timings : {:.1}ms {:.1}FPS\n",
|
builder.appendff("Timings : {:.1}ms {:.1}FPS\n",
|
||||||
static_cast<double>(milliseconds) / frame_counter,
|
static_cast<double>(milliseconds) / frame_counter,
|
||||||
(milliseconds > 0) ? 1000.0 * frame_counter / milliseconds : 9999.0));
|
(milliseconds > 0) ? 1000.0 * frame_counter / milliseconds : 9999.0);
|
||||||
builder.append(DeprecatedString::formatted("Triangles : {}\n", g_num_rasterized_triangles));
|
builder.appendff("Triangles : {}\n", g_num_rasterized_triangles);
|
||||||
builder.append(DeprecatedString::formatted("SIMD usage : {}%\n", g_num_quads > 0 ? g_num_pixels_shaded * 25 / g_num_quads : 0));
|
builder.appendff("SIMD usage : {}%\n", g_num_quads > 0 ? g_num_pixels_shaded * 25 / g_num_quads : 0);
|
||||||
builder.append(DeprecatedString::formatted("Pixels : {}, Stencil: {}%, Shaded: {}%, Blended: {}%, Overdraw: {}%\n",
|
builder.appendff("Pixels : {}, Stencil: {}%, Shaded: {}%, Blended: {}%, Overdraw: {}%\n",
|
||||||
g_num_pixels,
|
g_num_pixels,
|
||||||
g_num_pixels > 0 ? g_num_stencil_writes * 100 / g_num_pixels : 0,
|
g_num_pixels > 0 ? g_num_stencil_writes * 100 / g_num_pixels : 0,
|
||||||
g_num_pixels > 0 ? g_num_pixels_shaded * 100 / g_num_pixels : 0,
|
g_num_pixels > 0 ? g_num_pixels_shaded * 100 / g_num_pixels : 0,
|
||||||
g_num_pixels_shaded > 0 ? g_num_pixels_blended * 100 / g_num_pixels_shaded : 0,
|
g_num_pixels_shaded > 0 ? g_num_pixels_blended * 100 / g_num_pixels_shaded : 0,
|
||||||
num_rendertarget_pixels > 0 ? g_num_pixels_shaded * 100 / num_rendertarget_pixels - 100 : 0));
|
num_rendertarget_pixels > 0 ? g_num_pixels_shaded * 100 / num_rendertarget_pixels - 100 : 0);
|
||||||
builder.append(DeprecatedString::formatted("Sampler calls: {}\n", g_num_sampler_calls));
|
builder.appendff("Sampler calls: {}\n", g_num_sampler_calls);
|
||||||
|
|
||||||
debug_string = builder.to_deprecated_string();
|
debug_string = builder.to_string().release_value_but_fixme_should_propagate_errors();
|
||||||
|
|
||||||
frame_counter = 0;
|
frame_counter = 0;
|
||||||
timer.start();
|
timer.start();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue