From 2d01db805e53b7522704b22636b249d82478f4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 18 Dec 2018 10:10:53 +0100 Subject: [PATCH] Remove no-op DrawBuffer::End() --- GPU/Vulkan/DebugVisVulkan.cpp | 1 - UI/ControlMappingScreen.cpp | 3 +-- UI/EmuScreen.cpp | 3 +-- UI/MiscScreens.cpp | 2 -- UI/NativeApp.cpp | 1 - ext/native/gfx_es2/draw_buffer.cpp | 4 ---- ext/native/gfx_es2/draw_buffer.h | 4 +--- ext/native/ui/ui.cpp | 9 --------- ext/native/ui/ui.h | 6 +----- ext/native/ui/ui_context.cpp | 7 ------- ext/native/ui/ui_context.h | 1 - ext/native/ui/ui_screen.cpp | 1 - 12 files changed, 4 insertions(+), 38 deletions(-) diff --git a/GPU/Vulkan/DebugVisVulkan.cpp b/GPU/Vulkan/DebugVisVulkan.cpp index bc0e17ad63..d93195bc16 100644 --- a/GPU/Vulkan/DebugVisVulkan.cpp +++ b/GPU/Vulkan/DebugVisVulkan.cpp @@ -37,7 +37,6 @@ void DrawAllocatorVis(UIContext *ui, GPUInterface *gpu) { int x = padding; int y = starty; int w = columnWidth; // We will double this when actually drawing to make the pixels visible. - ui->End(); ui->Begin(); diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index 3412cc34b5..68448d059b 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -478,10 +478,9 @@ void JoystickHistoryView::Draw(UIContext &dc) { dc.Draw()->DrawImage(I_CROSS, x, y, 0.8f, colorAlpha(0xFFFFFF, alpha), ALIGN_CENTER); a++; } - dc.End(); dc.BeginNoTex(); dc.Draw()->RectOutline(bounds_.centerX() - minRadius, bounds_.centerY() - minRadius, minRadius * 2, minRadius * 2, 0x80FFFFFF); - dc.End(); + dc.Flush(); dc.Begin(); } else { dc.DrawText("N/A", bounds_.centerX(), bounds_.centerY(), 0xFFFFFFFF, ALIGN_CENTER); diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 91220e16b5..83442497b0 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1351,8 +1351,7 @@ void EmuScreen::renderUI() { DrawProfile(*ctx); } #endif - - ctx->End(); + ctx->Flush(); } void EmuScreen::autoLoad() { diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 74bb4cfc5f..8d7891c08a 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -513,7 +513,6 @@ void LogoScreen::render() { dc.DrawText(gr->T(apiName), bounds.centerX(), ppsspp_org_y + 50, textColor, ALIGN_CENTER); #endif - dc.End(); dc.Flush(); } @@ -768,6 +767,5 @@ void CreditsScreen::render() { y += itemHeight; } - dc.End(); dc.Flush(); } diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 2dd8ca97f5..d4ad6b19ad 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -928,7 +928,6 @@ void RenderOverlays(UIContext *dc, void *userdata) { UI::Drawable solid(colors[i & 3]); dc->FillRect(solid, bounds); } - dc->End(); dc->Flush(); } diff --git a/ext/native/gfx_es2/draw_buffer.cpp b/ext/native/gfx_es2/draw_buffer.cpp index 7f343ee928..603d49ee8e 100644 --- a/ext/native/gfx_es2/draw_buffer.cpp +++ b/ext/native/gfx_es2/draw_buffer.cpp @@ -80,10 +80,6 @@ void DrawBuffer::Begin(Draw::Pipeline *program) { count_ = 0; } -void DrawBuffer::End() { - // Currently does nothing, but call it! -} - void DrawBuffer::Flush(bool set_blend_state) { using namespace Draw; if (count_ == 0) diff --git a/ext/native/gfx_es2/draw_buffer.h b/ext/native/gfx_es2/draw_buffer.h index e797152554..4b504dfcb8 100644 --- a/ext/native/gfx_es2/draw_buffer.h +++ b/ext/native/gfx_es2/draw_buffer.h @@ -63,7 +63,7 @@ public: ~DrawBuffer(); void Begin(Draw::Pipeline *pipeline); - void End(); + void Flush(bool set_blend_state = true); // TODO: Enforce these. Now Init is autocalled and shutdown not called. void Init(Draw::DrawContext *t3d, Draw::Pipeline *pipeline); @@ -74,8 +74,6 @@ public: int Count() const { return count_; } - void Flush(bool set_blend_state = true); - void Rect(float x, float y, float w, float h, uint32_t color, int align = ALIGN_TOPLEFT); void hLine(float x1, float y, float x2, uint32_t color); void vLine(float x, float y1, float y2, uint32_t color); diff --git a/ext/native/ui/ui.cpp b/ext/native/ui/ui.cpp index 0ed93c504c..c0bfb3fad7 100644 --- a/ext/native/ui/ui.cpp +++ b/ext/native/ui/ui.cpp @@ -24,12 +24,3 @@ void UIFlush() { ui_draw2d.Flush(); ui_draw2d_front.Flush(); } - -void UIEnd() { - ui_draw2d.End(); - ui_draw2d_front.End(); - - ui_draw2d.Flush(); - ui_draw2d_front.Flush(); -} - diff --git a/ext/native/ui/ui.h b/ext/native/ui/ui.h index 369c3ce4b1..f3e2ff327f 100644 --- a/ext/native/ui/ui.h +++ b/ext/native/ui/ui.h @@ -60,11 +60,7 @@ private: }; -// Call at start of frame +// Begins/flushes the two UI drawbuffers together. void UIBegin(Draw::Pipeline *shaderSet); - -// Call at end of frame. - -void UIEnd(); void UIFlush(); diff --git a/ext/native/ui/ui_context.cpp b/ext/native/ui/ui_context.cpp index a148a0b60d..492191442a 100644 --- a/ext/native/ui/ui_context.cpp +++ b/ext/native/ui/ui_context.cpp @@ -58,20 +58,13 @@ void UIContext::RebindTexture() const { void UIContext::Flush() { if (uidrawbuffer_) { - uidrawbuffer_->End(); uidrawbuffer_->Flush(); } if (uidrawbufferTop_) { - uidrawbufferTop_->End(); uidrawbufferTop_->Flush(); } } -void UIContext::End() { - UIEnd(); - Flush(); -} - // TODO: Support transformed bounds using stencil instead. void UIContext::PushScissor(const Bounds &bounds) { Flush(); diff --git a/ext/native/ui/ui_context.h b/ext/native/ui/ui_context.h index 3b6c4d7e43..8d9d1c1f65 100644 --- a/ext/native/ui/ui_context.h +++ b/ext/native/ui/ui_context.h @@ -52,7 +52,6 @@ public: void Begin(); void BeginNoTex(); void Flush(); - void End(); void RebindTexture() const; diff --git a/ext/native/ui/ui_screen.cpp b/ext/native/ui/ui_screen.cpp index 3339c8d25b..eb87763ed6 100644 --- a/ext/native/ui/ui_screen.cpp +++ b/ext/native/ui/ui_screen.cpp @@ -113,7 +113,6 @@ void UIScreen::render() { uiContext->Begin(); DrawBackground(*uiContext); root_->Draw(*uiContext); - uiContext->End(); uiContext->Flush(); uiContext->PopTransform();