From 8761bf2bc9df1d811f9d226d472d748d4bf6053a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 5 Oct 2020 00:05:28 +0200 Subject: [PATCH] Move text rendering to Common. --- CMakeLists.txt | 18 +++++---- Common/Common.vcxproj | 10 +++++ Common/Common.vcxproj.filters | 33 +++++++++++++++++ Common/Render/DrawBuffer.cpp | 2 +- .../Render/Text}/draw_text.cpp | 13 ++++--- .../Render/Text}/draw_text.h | 2 +- .../Render/Text}/draw_text_android.cpp | 9 ++--- .../Render/Text}/draw_text_android.h | 2 +- .../Render/Text}/draw_text_qt.cpp | 4 +- .../Render/Text}/draw_text_qt.h | 2 +- .../Render/Text}/draw_text_uwp.cpp | 4 +- .../Render/Text}/draw_text_uwp.h | 2 +- .../Render/Text}/draw_text_win.cpp | 4 +- .../Render/Text}/draw_text_win.h | 2 +- Common/UI/Context.cpp | 2 +- Core/Util/PPGeDraw.cpp | 2 +- UI/EmuScreen.cpp | 2 +- UI/NativeApp.cpp | 2 +- UWP/CommonUWP/CommonUWP.vcxproj | 10 +++++ UWP/CommonUWP/CommonUWP.vcxproj.filters | 33 +++++++++++++++++ UWP/NativeUWP/NativeUWP.vcxproj | 4 -- UWP/NativeUWP/NativeUWP.vcxproj.filters | 17 --------- android/jni/Android.mk | 6 +-- ext/native/native.vcxproj | 14 ------- ext/native/native.vcxproj.filters | 37 ------------------- libretro/Makefile.common | 6 +-- 26 files changed, 130 insertions(+), 112 deletions(-) rename {ext/native/gfx_es2 => Common/Render/Text}/draw_text.cpp (91%) rename {ext/native/gfx_es2 => Common/Render/Text}/draw_text.h (100%) rename {ext/native/gfx_es2 => Common/Render/Text}/draw_text_android.cpp (99%) rename {ext/native/gfx_es2 => Common/Render/Text}/draw_text_android.h (97%) rename {ext/native/gfx_es2 => Common/Render/Text}/draw_text_qt.cpp (98%) rename {ext/native/gfx_es2 => Common/Render/Text}/draw_text_qt.h (96%) rename {ext/native/gfx_es2 => Common/Render/Text}/draw_text_uwp.cpp (99%) rename {ext/native/gfx_es2 => Common/Render/Text}/draw_text_uwp.h (97%) rename {ext/native/gfx_es2 => Common/Render/Text}/draw_text_win.cpp (99%) rename {ext/native/gfx_es2 => Common/Render/Text}/draw_text_win.h (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a70330c5ae22..5cceb4091344 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -560,6 +560,16 @@ add_library(Common STATIC Common/Render/TextureAtlas.h Common/Render/DrawBuffer.cpp Common/Render/DrawBuffer.h + Common/Render/Text/draw_text.cpp + Common/Render/Text/draw_text.h + Common/Render/Text/draw_text_android.cpp + Common/Render/Text/draw_text_android.h + Common/Render/Text/draw_text_qt.cpp + Common/Render/Text/draw_text_qt.h + Common/Render/Text/draw_text_win.cpp + Common/Render/Text/draw_text_win.h + Common/Render/Text/draw_text_uwp.cpp + Common/Render/Text/draw_text_uwp.h Common/System/Display.cpp Common/System/Display.h Common/Thread/Executor.cpp @@ -1062,14 +1072,6 @@ endif() add_library(native STATIC ${nativeExtra} - ext/native/gfx_es2/draw_text.cpp - ext/native/gfx_es2/draw_text.h - ext/native/gfx_es2/draw_text_win.cpp - ext/native/gfx_es2/draw_text_win.h - ext/native/gfx_es2/draw_text_qt.cpp - ext/native/gfx_es2/draw_text_qt.h - ext/native/gfx_es2/draw_text_android.cpp - ext/native/gfx_es2/draw_text_android.h ext/jpge/jpgd.cpp ext/jpge/jpgd.h ext/jpge/jpge.cpp diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index cc8f5594d0c2..16ba97f6c250 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -431,6 +431,11 @@ + + + + + @@ -753,6 +758,11 @@ + + + + + diff --git a/Common/Common.vcxproj.filters b/Common/Common.vcxproj.filters index d38ea7106801..10c28d065c35 100644 --- a/Common/Common.vcxproj.filters +++ b/Common/Common.vcxproj.filters @@ -357,6 +357,21 @@ GPU\Vulkan + + Render\Text + + + Render\Text + + + Render\Text + + + Render\Text + + + Render\Text + @@ -692,6 +707,21 @@ GPU\Vulkan + + Render\Text + + + Render\Text + + + Render\Text + + + Render\Text + + + Render\Text + @@ -790,6 +820,9 @@ {c9aba118-5c31-4607-9a69-18eca9f92b44} + + {9da96cce-c74a-4669-b755-c95defbe1e93} + diff --git a/Common/Render/DrawBuffer.cpp b/Common/Render/DrawBuffer.cpp index d0d2e42a87c1..f23c753726b6 100644 --- a/Common/Render/DrawBuffer.cpp +++ b/Common/Render/DrawBuffer.cpp @@ -7,7 +7,7 @@ #include "Common/Math/math_util.h" #include "Common/Render/TextureAtlas.h" #include "Common/Render/DrawBuffer.h" -#include "gfx_es2/draw_text.h" +#include "Common/Render/Text/draw_text.h" #include "Common/Data/Encoding/Utf8.h" #include "Common/Data/Text/WrapText.h" diff --git a/ext/native/gfx_es2/draw_text.cpp b/Common/Render/Text/draw_text.cpp similarity index 91% rename from ext/native/gfx_es2/draw_text.cpp rename to Common/Render/Text/draw_text.cpp index b85e6eeb714c..e236065483bc 100644 --- a/ext/native/gfx_es2/draw_text.cpp +++ b/Common/Render/Text/draw_text.cpp @@ -1,13 +1,16 @@ +#include "ppsspp_config.h" + #include "Common/System/Display.h" #include "Common/GPU/thin3d.h" #include "Common/Data/Hash/Hash.h" #include "Common/Data/Text/WrapText.h" #include "Common/Data/Encoding/Utf8.h" -#include "gfx_es2/draw_text.h" -#include "gfx_es2/draw_text_win.h" -#include "gfx_es2/draw_text_uwp.h" -#include "gfx_es2/draw_text_qt.h" -#include "gfx_es2/draw_text_android.h" + +#include "Common/Render/Text/draw_text.h" +#include "Common/Render/Text/draw_text_win.h" +#include "Common/Render/Text/draw_text_uwp.h" +#include "Common/Render/Text/draw_text_qt.h" +#include "Common/Render/Text/draw_text_android.h" TextDrawer::TextDrawer(Draw::DrawContext *draw) : draw_(draw) { // These probably shouldn't be state. diff --git a/ext/native/gfx_es2/draw_text.h b/Common/Render/Text/draw_text.h similarity index 100% rename from ext/native/gfx_es2/draw_text.h rename to Common/Render/Text/draw_text.h index 4d1862834d28..252029b8a3d7 100644 --- a/ext/native/gfx_es2/draw_text.h +++ b/Common/Render/Text/draw_text.h @@ -13,8 +13,8 @@ #include #include -#include "Common/Render/DrawBuffer.h" #include "Common/Data/Text/WrapText.h" +#include "Common/Render/DrawBuffer.h" namespace Draw { class DrawContext; diff --git a/ext/native/gfx_es2/draw_text_android.cpp b/Common/Render/Text/draw_text_android.cpp similarity index 99% rename from ext/native/gfx_es2/draw_text_android.cpp rename to Common/Render/Text/draw_text_android.cpp index 263494f78ced..7e6a66d85fa4 100644 --- a/ext/native/gfx_es2/draw_text_android.cpp +++ b/Common/Render/Text/draw_text_android.cpp @@ -1,16 +1,15 @@ +#include "Common/Log.h" +#include "Common/StringUtils.h" #include "Common/System/Display.h" #include "Common/GPU/thin3d.h" #include "Common/Data/Hash/Hash.h" #include "Common/Data/Text/WrapText.h" #include "Common/Data/Encoding/Utf8.h" -#include "gfx_es2/draw_text.h" -#include "gfx_es2/draw_text_android.h" +#include "Common/Render/Text/draw_text.h" +#include "Common/Render/Text/draw_text_android.h" #include "android/jni/app-android.h" -#include "Common/Log.h" -#include "Common/StringUtils.h" - #if PPSSPP_PLATFORM(ANDROID) && !defined(__LIBRETRO__) #include diff --git a/ext/native/gfx_es2/draw_text_android.h b/Common/Render/Text/draw_text_android.h similarity index 97% rename from ext/native/gfx_es2/draw_text_android.h rename to Common/Render/Text/draw_text_android.h index 51e5a3ab82fb..4b95bdeb7576 100644 --- a/ext/native/gfx_es2/draw_text_android.h +++ b/Common/Render/Text/draw_text_android.h @@ -3,7 +3,7 @@ #include "ppsspp_config.h" #include -#include "gfx_es2/draw_text.h" +#include "Common/Render/Text/draw_text.h" #if PPSSPP_PLATFORM(ANDROID) diff --git a/ext/native/gfx_es2/draw_text_qt.cpp b/Common/Render/Text/draw_text_qt.cpp similarity index 98% rename from ext/native/gfx_es2/draw_text_qt.cpp rename to Common/Render/Text/draw_text_qt.cpp index 91f45fe7ecab..166aac3a47bf 100644 --- a/ext/native/gfx_es2/draw_text_qt.cpp +++ b/Common/Render/Text/draw_text_qt.cpp @@ -3,8 +3,8 @@ #include "Common/Data/Hash/Hash.h" #include "Common/Data/Text/WrapText.h" #include "Common/Data/Encoding/Utf8.h" -#include "gfx_es2/draw_text.h" -#include "gfx_es2/draw_text_qt.h" +#include "Common/Render/Text/draw_text.h" +#include "Common/Render/Text/draw_text_qt.h" #include "Common/Log.h" diff --git a/ext/native/gfx_es2/draw_text_qt.h b/Common/Render/Text/draw_text_qt.h similarity index 96% rename from ext/native/gfx_es2/draw_text_qt.h rename to Common/Render/Text/draw_text_qt.h index e8c01cd118cb..2ac661b4addc 100644 --- a/ext/native/gfx_es2/draw_text_qt.h +++ b/Common/Render/Text/draw_text_qt.h @@ -3,7 +3,7 @@ #include "ppsspp_config.h" #include -#include "gfx_es2/draw_text.h" +#include "Common/Render/Text/draw_text.h" #if defined(USING_QT_UI) diff --git a/ext/native/gfx_es2/draw_text_uwp.cpp b/Common/Render/Text/draw_text_uwp.cpp similarity index 99% rename from ext/native/gfx_es2/draw_text_uwp.cpp rename to Common/Render/Text/draw_text_uwp.cpp index 4ea0bbfcc914..7ec375ae542b 100644 --- a/ext/native/gfx_es2/draw_text_uwp.cpp +++ b/Common/Render/Text/draw_text_uwp.cpp @@ -3,8 +3,8 @@ #include "Common/Data/Hash/Hash.h" #include "Common/Data/Text/WrapText.h" #include "Common/Data/Encoding/Utf8.h" -#include "gfx_es2/draw_text.h" -#include "gfx_es2/draw_text_uwp.h" +#include "Common/Render/Text/draw_text.h" +#include "Common/Render/Text/draw_text_uwp.h" #include "Common/Log.h" #include "Common/StringUtils.h" diff --git a/ext/native/gfx_es2/draw_text_uwp.h b/Common/Render/Text/draw_text_uwp.h similarity index 97% rename from ext/native/gfx_es2/draw_text_uwp.h rename to Common/Render/Text/draw_text_uwp.h index 59995f491b43..816ae7ec0660 100644 --- a/ext/native/gfx_es2/draw_text_uwp.h +++ b/Common/Render/Text/draw_text_uwp.h @@ -3,7 +3,7 @@ #include "ppsspp_config.h" #include -#include "gfx_es2/draw_text.h" +#include "Common/Render/Text/draw_text.h" #if PPSSPP_PLATFORM(UWP) diff --git a/ext/native/gfx_es2/draw_text_win.cpp b/Common/Render/Text/draw_text_win.cpp similarity index 99% rename from ext/native/gfx_es2/draw_text_win.cpp rename to Common/Render/Text/draw_text_win.cpp index 883eda144442..e7518857ef35 100644 --- a/ext/native/gfx_es2/draw_text_win.cpp +++ b/Common/Render/Text/draw_text_win.cpp @@ -3,8 +3,8 @@ #include "Common/Data/Hash/Hash.h" #include "Common/Data/Text/WrapText.h" #include "Common/Data/Encoding/Utf8.h" -#include "gfx_es2/draw_text.h" -#include "gfx_es2/draw_text_win.h" +#include "Common/Render/Text/draw_text.h" +#include "Common/Render/Text/draw_text_win.h" #include "Common/Log.h" #include "Common/StringUtils.h" diff --git a/ext/native/gfx_es2/draw_text_win.h b/Common/Render/Text/draw_text_win.h similarity index 97% rename from ext/native/gfx_es2/draw_text_win.h rename to Common/Render/Text/draw_text_win.h index 41489eefbbe4..c59fa91db4fc 100644 --- a/ext/native/gfx_es2/draw_text_win.h +++ b/Common/Render/Text/draw_text_win.h @@ -3,7 +3,7 @@ #include "ppsspp_config.h" #include -#include "gfx_es2/draw_text.h" +#include "Common/Render/Text/draw_text.h" #if defined(_WIN32) && !defined(USING_QT_UI) && !PPSSPP_PLATFORM(UWP) diff --git a/Common/UI/Context.cpp b/Common/UI/Context.cpp index 467aa35166f6..adfa7d89d0bc 100644 --- a/Common/UI/Context.cpp +++ b/Common/UI/Context.cpp @@ -8,7 +8,7 @@ #include "Common/UI/View.h" #include "Common/UI/Context.h" #include "Common/Render/DrawBuffer.h" -#include "gfx_es2/draw_text.h" +#include "Common/Render/Text/draw_text.h" #include "Common/Log.h" #include "UI/TextureUtil.h" diff --git a/Core/Util/PPGeDraw.cpp b/Core/Util/PPGeDraw.cpp index b24802944d7e..f103b8bf15d7 100644 --- a/Core/Util/PPGeDraw.cpp +++ b/Core/Util/PPGeDraw.cpp @@ -18,7 +18,7 @@ #include #include "Common/Render/TextureAtlas.h" -#include "gfx_es2/draw_text.h" +#include "Common/Render/Text/draw_text.h" #include "Common/Data/Color/RGBAUtil.h" #include "Common/File/VFS/VFS.h" diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 079aae9795c4..b3d11af15507 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -21,7 +21,7 @@ #include "Common/Render/TextureAtlas.h" #include "Common/GPU/OpenGL/GLFeatures.h" -#include "gfx_es2/draw_text.h" +#include "Common/Render/Text/draw_text.h" #include "Common/UI/Root.h" #include "Common/UI/UI.h" diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 0ae20b16a084..ef7547d4115d 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -46,7 +46,7 @@ #include "Common/Net/HTTPClient.h" #include "Common/Net/Resolve.h" #include "Common/Render/TextureAtlas.h" -#include "gfx_es2/draw_text.h" +#include "Common/Render/Text/draw_text.h" #include "Common/GPU/OpenGL/GLFeatures.h" #include "Common/GPU/thin3d.h" #include "Common/UI/UI.h" diff --git a/UWP/CommonUWP/CommonUWP.vcxproj b/UWP/CommonUWP/CommonUWP.vcxproj index 2a980dc4a6b3..f1ad520e499b 100644 --- a/UWP/CommonUWP/CommonUWP.vcxproj +++ b/UWP/CommonUWP/CommonUWP.vcxproj @@ -439,6 +439,11 @@ + + + + + @@ -554,6 +559,11 @@ + + + + + diff --git a/UWP/CommonUWP/CommonUWP.vcxproj.filters b/UWP/CommonUWP/CommonUWP.vcxproj.filters index 7d3f1f9ba4e2..071580a8711f 100644 --- a/UWP/CommonUWP/CommonUWP.vcxproj.filters +++ b/UWP/CommonUWP/CommonUWP.vcxproj.filters @@ -82,6 +82,9 @@ {2eb259f7-2735-493a-88be-96eb38f1b34e} + + {28139b08-f8d5-41a2-a5ee-bf86cf1469c3} + @@ -347,6 +350,21 @@ GPU\GL + + Render\Text + + + Render\Text + + + Render\Text + + + Render\Text + + + Render\Text + @@ -627,6 +645,21 @@ GPU\GL + + Render\Text + + + Render\Text + + + Render\Text + + + Render\Text + + + Render\Text + diff --git a/UWP/NativeUWP/NativeUWP.vcxproj b/UWP/NativeUWP/NativeUWP.vcxproj index ed65f21e62af..fe5acb8cd94d 100644 --- a/UWP/NativeUWP/NativeUWP.vcxproj +++ b/UWP/NativeUWP/NativeUWP.vcxproj @@ -379,14 +379,10 @@ - - - - Create Create diff --git a/UWP/NativeUWP/NativeUWP.vcxproj.filters b/UWP/NativeUWP/NativeUWP.vcxproj.filters index b1fe9b4b875f..abd4278e7857 100644 --- a/UWP/NativeUWP/NativeUWP.vcxproj.filters +++ b/UWP/NativeUWP/NativeUWP.vcxproj.filters @@ -2,26 +2,9 @@ - - gfx - - - gfx - - - gfx - - - gfx - - - - - {85815953-a0f8-409b-bbe9-c28f126ae7bf} - \ No newline at end of file diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 08c1f879507e..25632e73cdd6 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -104,16 +104,16 @@ endif NATIVE_FILES :=\ $(SRC)/Common/Render/DrawBuffer.cpp \ $(SRC)/Common/Render/TextureAtlas.cpp \ + $(SRC)/Common/GPU/OpenGL/gl3stub.c \ $(SRC)/Common/GPU/OpenGL/thin3d_gl.cpp \ $(SRC)/Common/GPU/OpenGL/GLDebugLog.cpp \ $(SRC)/Common/GPU/OpenGL/GLSLProgram.cpp \ - $(SRC)/Common/GPU/OpenGL/gl3stub.c \ $(SRC)/Common/GPU/OpenGL/GLFeatures.cpp \ $(SRC)/Common/GPU/OpenGL/GLRenderManager.cpp \ $(SRC)/Common/GPU/OpenGL/GLQueueRunner.cpp \ $(SRC)/Common/GPU/OpenGL/DataFormatGL.cpp \ - $(SRC)/ext/native/gfx_es2/draw_text.cpp.arm \ - $(SRC)/ext/native/gfx_es2/draw_text_android.cpp.arm + $(SRC)/Common/Render/Text/draw_text.cpp.arm \ + $(SRC)/Common/Render/Text/draw_text_android.cpp.arm EGL_FILES := \ $(SRC)/Common/GL/GLInterface/EGL.cpp \ diff --git a/ext/native/native.vcxproj b/ext/native/native.vcxproj index a66ede425e40..14fd640a741a 100644 --- a/ext/native/native.vcxproj +++ b/ext/native/native.vcxproj @@ -362,20 +362,6 @@ - - - - - - - - - - - - - - diff --git a/ext/native/native.vcxproj.filters b/ext/native/native.vcxproj.filters index b1773f1582ee..949fbbb1effc 100644 --- a/ext/native/native.vcxproj.filters +++ b/ext/native/native.vcxproj.filters @@ -6,43 +6,6 @@ - - gfx - - - gfx - - - gfx - - - gfx - - - gfx - - - - - gfx - - - gfx - - - gfx - - - gfx - - - gfx - - - - - {9da89505-72a1-40e6-86e5-705372db1608} - {4515306f-4664-46bf-a89b-abfec5520a15} diff --git a/libretro/Makefile.common b/libretro/Makefile.common index ddd0b58db117..6f8ffebe6c08 100644 --- a/libretro/Makefile.common +++ b/libretro/Makefile.common @@ -326,21 +326,21 @@ SOURCES_CXX += \ ifeq ($(PLATFORM_EXT), win32) SOURCES_CXX += $(COMMONDIR)/MemArenaWin32.cpp \ $(EXTDIR)/glslang/glslang/OSDependent/Windows/ossource.cpp \ - $(NATIVEDIR)/gfx_es2/draw_text_win.cpp + $(COMMONDIR)/Render/Text/draw_text_win.cpp else ifeq ($(PLATFORM_EXT), darwin) SOURCES_CXX += $(COMMONDIR)/MemArenaDarwin.cpp \ $(EXTDIR)/glslang/glslang/OSDependent/Unix/ossource.cpp else ifeq ($(PLATFORM_EXT), android) SOURCES_CXX += $(COMMONDIR)/MemArenaAndroid.cpp \ $(EXTDIR)/glslang/glslang/OSDependent/Unix/ossource.cpp \ - $(NATIVEDIR)/gfx_es2/draw_text_android.cpp + $(COMMONDIR)/Render/Text/draw_text_android.cpp else SOURCES_CXX += $(COMMONDIR)/MemArenaPosix.cpp \ $(EXTDIR)/glslang/glslang/OSDependent/Unix/ossource.cpp endif SOURCES_CXX += \ - $(NATIVEDIR)/gfx_es2/draw_text.cpp \ + $(COMMONDIR)/Render/Text/draw_text.cpp \ $(EXTDIR)/jpge/jpgd.cpp \ $(EXTDIR)/jpge/jpge.cpp \ $(COREDIR)/AVIDump.cpp \