Files
UnrealEngineUWP/Engine/Source/Runtime/SlateRHIRenderer/Private/SlateRHIRendererModule.cpp

149 lines
4.9 KiB
C++
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "CoreMinimal.h"
#include "Misc/ConfigCacheIni.h"
#include "Modules/ModuleManager.h"
#include "Fonts/FontTypes.h"
#include "Fonts/FontCache.h"
#include "Rendering/RenderingCommon.h"
#include "Rendering/DrawElements.h"
#include "Rendering/SlateRenderer.h"
#include "Interfaces/ISlate3DRenderer.h"
#include "Interfaces/ISlateRHIRendererModule.h"
#include "SlateRHIFontTexture.h"
#include "SlateRHIResourceManager.h"
#include "SlateRHIRenderer.h"
#include "Slate3DRenderer.h"
#include "SlateUpdatableBuffer.h"
class FSlateRHIFontAtlasFactory : public ISlateFontAtlasFactory
{
public:
FSlateRHIFontAtlasFactory()
{
auto GetAtlasSizeFromConfig = [](const TCHAR* InConfigKey, const FString& InConfigFilename, int32& OutAtlasSize)
{
if (GConfig)
{
GConfig->GetInt(TEXT("SlateRenderer"), InConfigKey, OutAtlasSize, InConfigFilename);
if (GConfig->GetInt(TEXT("SlateRenderer"), TEXT("FontAtlasSize"), OutAtlasSize, InConfigFilename))
{
UE_LOG(LogCore, Warning, TEXT("The 'FontAtlasSize' setting for 'SlateRenderer' is deprecated. Use '%s' instead."), InConfigKey);
}
}
OutAtlasSize = FMath::Clamp(OutAtlasSize, 128, 2048);
};
GrayscaleAtlasSize = GIsEditor ? 2048 : 1024;
ColorAtlasSize = 512;
{
const FString& ConfigFilename = GIsEditor ? GEditorIni : GEngineIni;
GetAtlasSizeFromConfig(TEXT("GrayscaleFontAtlasSize"), ConfigFilename, GrayscaleAtlasSize);
GetAtlasSizeFromConfig(TEXT("ColorFontAtlasSize"), ConfigFilename, ColorAtlasSize);
}
}
virtual ~FSlateRHIFontAtlasFactory()
{
}
Added support for rendering TTF/OTF fonts containing bitmaps, including color fonts (like Emoji) Note: Bitmap fonts require FreeType 2.10, and support is compiled out if using an older version. Font Rendering: - ApplySizeAndScale now computes the desired pixel size manually (using our desired DPI) rather than calling FT_Set_Char_Size. - This also includes the font scale, which avoids the call to FT_Set_Transform and lets us remove some workarounds for inconsistent scaling from FreeType. - For scalable fonts the desired pixel size is passed to FT_Set_Pixel_Sizes. - For bitmap fonts the desired pixel size is used to find the most suitable strike size (set via FT_Select_Size) and the ratio needed to scale that strike to the desired size (see GetBitmapAtlasScale and GetBitmapRenderScale). - AppendGlyphFlags has been updated to load color data (when available), and to only exclude bitmap data for fonts that also have scalable data. - FSlateFontRenderer::GetRenderDataInternal has been updated to handle color bitmap rendering (BGRA, sRGB) in addition to the existing grayscale rendering. - It will also handle scaling down bitmap font strikes that are larger than the desired size, which saves space in the atlas (see GetBitmapAtlasScale). - It won't scale up any bitmaps, as that is handled by the transform applied when batching the glyph quads for rendering (see GetBitmapRenderScale). - Added support for disabling outline and tint for bitmap fonts (in Slate and Canvas). - Added support for batching both grayscale (8-bit alpha-only) and color (8-bit per-channel BGRA) font quads from a font texture atlas (in RHI, D3D, and OpenGL). - Removed unused data from FCharacterRenderData. #jira #rb Matt.Kuhlenschmidt #ROBOMERGE-SOURCE: CL 8177432 via CL 8197318 #ROBOMERGE-BOT: (v401-8057353) [CL 8197520 by jamie dale in Main branch]
2019-08-21 17:23:59 -04:00
virtual FIntPoint GetAtlasSize(const bool InIsGrayscale) const override
{
Added support for rendering TTF/OTF fonts containing bitmaps, including color fonts (like Emoji) Note: Bitmap fonts require FreeType 2.10, and support is compiled out if using an older version. Font Rendering: - ApplySizeAndScale now computes the desired pixel size manually (using our desired DPI) rather than calling FT_Set_Char_Size. - This also includes the font scale, which avoids the call to FT_Set_Transform and lets us remove some workarounds for inconsistent scaling from FreeType. - For scalable fonts the desired pixel size is passed to FT_Set_Pixel_Sizes. - For bitmap fonts the desired pixel size is used to find the most suitable strike size (set via FT_Select_Size) and the ratio needed to scale that strike to the desired size (see GetBitmapAtlasScale and GetBitmapRenderScale). - AppendGlyphFlags has been updated to load color data (when available), and to only exclude bitmap data for fonts that also have scalable data. - FSlateFontRenderer::GetRenderDataInternal has been updated to handle color bitmap rendering (BGRA, sRGB) in addition to the existing grayscale rendering. - It will also handle scaling down bitmap font strikes that are larger than the desired size, which saves space in the atlas (see GetBitmapAtlasScale). - It won't scale up any bitmaps, as that is handled by the transform applied when batching the glyph quads for rendering (see GetBitmapRenderScale). - Added support for disabling outline and tint for bitmap fonts (in Slate and Canvas). - Added support for batching both grayscale (8-bit alpha-only) and color (8-bit per-channel BGRA) font quads from a font texture atlas (in RHI, D3D, and OpenGL). - Removed unused data from FCharacterRenderData. #jira #rb Matt.Kuhlenschmidt #ROBOMERGE-SOURCE: CL 8177432 via CL 8197318 #ROBOMERGE-BOT: (v401-8057353) [CL 8197520 by jamie dale in Main branch]
2019-08-21 17:23:59 -04:00
return InIsGrayscale
? FIntPoint(GrayscaleAtlasSize, GrayscaleAtlasSize)
: FIntPoint(ColorAtlasSize, ColorAtlasSize);
}
Added support for rendering TTF/OTF fonts containing bitmaps, including color fonts (like Emoji) Note: Bitmap fonts require FreeType 2.10, and support is compiled out if using an older version. Font Rendering: - ApplySizeAndScale now computes the desired pixel size manually (using our desired DPI) rather than calling FT_Set_Char_Size. - This also includes the font scale, which avoids the call to FT_Set_Transform and lets us remove some workarounds for inconsistent scaling from FreeType. - For scalable fonts the desired pixel size is passed to FT_Set_Pixel_Sizes. - For bitmap fonts the desired pixel size is used to find the most suitable strike size (set via FT_Select_Size) and the ratio needed to scale that strike to the desired size (see GetBitmapAtlasScale and GetBitmapRenderScale). - AppendGlyphFlags has been updated to load color data (when available), and to only exclude bitmap data for fonts that also have scalable data. - FSlateFontRenderer::GetRenderDataInternal has been updated to handle color bitmap rendering (BGRA, sRGB) in addition to the existing grayscale rendering. - It will also handle scaling down bitmap font strikes that are larger than the desired size, which saves space in the atlas (see GetBitmapAtlasScale). - It won't scale up any bitmaps, as that is handled by the transform applied when batching the glyph quads for rendering (see GetBitmapRenderScale). - Added support for disabling outline and tint for bitmap fonts (in Slate and Canvas). - Added support for batching both grayscale (8-bit alpha-only) and color (8-bit per-channel BGRA) font quads from a font texture atlas (in RHI, D3D, and OpenGL). - Removed unused data from FCharacterRenderData. #jira #rb Matt.Kuhlenschmidt #ROBOMERGE-SOURCE: CL 8177432 via CL 8197318 #ROBOMERGE-BOT: (v401-8057353) [CL 8197520 by jamie dale in Main branch]
2019-08-21 17:23:59 -04:00
virtual TSharedRef<FSlateFontAtlas> CreateFontAtlas(const bool InIsGrayscale) const override
{
Added support for rendering TTF/OTF fonts containing bitmaps, including color fonts (like Emoji) Note: Bitmap fonts require FreeType 2.10, and support is compiled out if using an older version. Font Rendering: - ApplySizeAndScale now computes the desired pixel size manually (using our desired DPI) rather than calling FT_Set_Char_Size. - This also includes the font scale, which avoids the call to FT_Set_Transform and lets us remove some workarounds for inconsistent scaling from FreeType. - For scalable fonts the desired pixel size is passed to FT_Set_Pixel_Sizes. - For bitmap fonts the desired pixel size is used to find the most suitable strike size (set via FT_Select_Size) and the ratio needed to scale that strike to the desired size (see GetBitmapAtlasScale and GetBitmapRenderScale). - AppendGlyphFlags has been updated to load color data (when available), and to only exclude bitmap data for fonts that also have scalable data. - FSlateFontRenderer::GetRenderDataInternal has been updated to handle color bitmap rendering (BGRA, sRGB) in addition to the existing grayscale rendering. - It will also handle scaling down bitmap font strikes that are larger than the desired size, which saves space in the atlas (see GetBitmapAtlasScale). - It won't scale up any bitmaps, as that is handled by the transform applied when batching the glyph quads for rendering (see GetBitmapRenderScale). - Added support for disabling outline and tint for bitmap fonts (in Slate and Canvas). - Added support for batching both grayscale (8-bit alpha-only) and color (8-bit per-channel BGRA) font quads from a font texture atlas (in RHI, D3D, and OpenGL). - Removed unused data from FCharacterRenderData. #jira #rb Matt.Kuhlenschmidt #ROBOMERGE-SOURCE: CL 8177432 via CL 8197318 #ROBOMERGE-BOT: (v401-8057353) [CL 8197520 by jamie dale in Main branch]
2019-08-21 17:23:59 -04:00
const FIntPoint AtlasSize = GetAtlasSize(InIsGrayscale);
return MakeShareable(new FSlateFontAtlasRHI(AtlasSize.X, AtlasSize.Y, InIsGrayscale));
}
Added support for rendering TTF/OTF fonts containing bitmaps, including color fonts (like Emoji) Note: Bitmap fonts require FreeType 2.10, and support is compiled out if using an older version. Font Rendering: - ApplySizeAndScale now computes the desired pixel size manually (using our desired DPI) rather than calling FT_Set_Char_Size. - This also includes the font scale, which avoids the call to FT_Set_Transform and lets us remove some workarounds for inconsistent scaling from FreeType. - For scalable fonts the desired pixel size is passed to FT_Set_Pixel_Sizes. - For bitmap fonts the desired pixel size is used to find the most suitable strike size (set via FT_Select_Size) and the ratio needed to scale that strike to the desired size (see GetBitmapAtlasScale and GetBitmapRenderScale). - AppendGlyphFlags has been updated to load color data (when available), and to only exclude bitmap data for fonts that also have scalable data. - FSlateFontRenderer::GetRenderDataInternal has been updated to handle color bitmap rendering (BGRA, sRGB) in addition to the existing grayscale rendering. - It will also handle scaling down bitmap font strikes that are larger than the desired size, which saves space in the atlas (see GetBitmapAtlasScale). - It won't scale up any bitmaps, as that is handled by the transform applied when batching the glyph quads for rendering (see GetBitmapRenderScale). - Added support for disabling outline and tint for bitmap fonts (in Slate and Canvas). - Added support for batching both grayscale (8-bit alpha-only) and color (8-bit per-channel BGRA) font quads from a font texture atlas (in RHI, D3D, and OpenGL). - Removed unused data from FCharacterRenderData. #jira #rb Matt.Kuhlenschmidt #ROBOMERGE-SOURCE: CL 8177432 via CL 8197318 #ROBOMERGE-BOT: (v401-8057353) [CL 8197520 by jamie dale in Main branch]
2019-08-21 17:23:59 -04:00
virtual TSharedPtr<ISlateFontTexture> CreateNonAtlasedTexture(const uint32 InWidth, const uint32 InHeight, const bool InIsGrayscale, const TArray<uint8>& InRawData) const override
Copying //UE4/Dev-Editor to Dev-Main (//UE4/Dev-Main) #lockdown nick.penwarden Change 2889481 on 2016/03/02 by Richard.TalbotWatkin Fixed socket preview component in Static Mesh Editor so that it remains correctly attached if the socket is renamed (Contributed by Manny-MADE). PR #2094 #jira UE-27338 - GitHub 2094 : BUGFIX: Socket preview component broken in Static Mesh Editor FSlateAtlasedTextureResource Made changes to the Perforce source control provider so that operations can be cancelled with immediate effect if there is an issue connecting to the server. #jira UE-24632 - "Updating file(s) source control status..." dialog doesn't allow Cancel #RB Thomas.Sarkanen Change 2890359 on 2016/03/02 by Nick.Darnell Jira Mirroring - Adding some tools for matching gits sha to perforce commits. Also adding the program for scraping jira issues and pushing them elsewhere. Change 2892008 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2813475 Change 2892086 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2813457 Change 2892117 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2812830 Change 2892316 on 2016/03/03 by Richard.TalbotWatkin Fixed conversion of brushes to volumes so that the original transform isn't lost. #jira UE-24404 - Convert Actor from BSP to volume can affect the actor transform Change 2892765 on 2016/03/03 by Andrew.Rodham Changed public facing level editor classes to use ILevelEditor instead of SLevelEditor #codereview Mike.Fricker Change 2894154 on 2016/03/04 by Richard.TalbotWatkin Fixed error in USplineComponent::GetSegmentLength when the segment is linear or constant. Change 2894481 on 2016/03/04 by Cody.Albert #jira UE-27830 Fixed mismatched layout name Change 2896339 on 2016/03/06 by Richard.TalbotWatkin Fixed undo issues in texture paint mode. #jira UE-21206 - Texture Painting bugs Change 2896713 on 2016/03/07 by Joe.Conley Replacing #ifndef with #pragma once Change 2896955 on 2016/03/07 by Cody.Albert #jira UE-27711 Added initialization for LastHighlightInteractionTime Change 2898895 on 2016/03/08 by Richard.TalbotWatkin More optimizations to editing actors with a large number of components. Improved performance when executing construction scripts. #jira UE-24821 - Blueprints with thousands of components perform very badly when selected in the Level Viewport Change 2900770 on 2016/03/09 by Joe.Conley Change #ifndef to #pragma once for headers under Runtime/Engine/Public Change 2900835 on 2016/03/09 by Richard.TalbotWatkin Fixed issues with scrolling items into view in STileView. Also fixed bugs in STileView::ReGenerateItems. #jira UE-20441 - Hitting F2 to rename an asset in the Content Browser moves the asset out of view if the CB is at default size and location #jira UE-20807 - Browse to Asset in Content Browser focuses just on the text #codereview Nick.Atamas Change 2900837 on 2016/03/09 by Richard.TalbotWatkin Added an OnKeyDownHandler to SSearchBox and SAssetSearchBox so that functionality for handling keypresses which is normally handled by SEditableText can be overridden. Added custom behavior to SAssetPicker and SAssetSearchBox so that up/down cursor keys can be used to change focus from the text box to the menu. #jira UE-20567 - UX Regression on Open Asset Panel This also addresses a similar issue with the auto-complete popup in the Content Browser search bar. Change 2900847 on 2016/03/09 by Richard.TalbotWatkin Fixed include dependency. Change 2900951 on 2016/03/09 by Richard.TalbotWatkin Fixed non-dependent name lookup for superclass member access. Change 2901325 on 2016/03/09 by Jamie.Dale PR #2107: Output Log Filtering (Contributed by phoboz-net) Change 2901391 on 2016/03/09 by Jamie.Dale Some more output log filter improvements We now defer the search until you finish typing, and the filter list itself now uses toggle buttons (like the content browser) so that you can toggle multiple filters without having to re-open the menu. Change 2901736 on 2016/03/09 by Alexis.Matte #jira UE-14632 Export staticmeshactor which are base on blueprint class as a blueprint instead of exporting it as an actor. #codereview nick.darnell Change 2903162 on 2016/03/10 by Alexis.Matte Fbx scene importer, Fix crash when changing the material base path in the material tab page #codereview nick.darnell Change 2903903 on 2016/03/10 by Richard.TalbotWatkin Fixed crash when attempting to paste an object from the level viewport into the content browser. #jira UE-26100 - Crash when attempting to copy an object from the world into the content browser Change 2903947 on 2016/03/10 by Richard.TalbotWatkin [CL 2937134 by Nick Darnell in Main branch]
2016-04-07 16:16:52 -04:00
{
if (GIsEditor)
{
Added support for rendering TTF/OTF fonts containing bitmaps, including color fonts (like Emoji) Note: Bitmap fonts require FreeType 2.10, and support is compiled out if using an older version. Font Rendering: - ApplySizeAndScale now computes the desired pixel size manually (using our desired DPI) rather than calling FT_Set_Char_Size. - This also includes the font scale, which avoids the call to FT_Set_Transform and lets us remove some workarounds for inconsistent scaling from FreeType. - For scalable fonts the desired pixel size is passed to FT_Set_Pixel_Sizes. - For bitmap fonts the desired pixel size is used to find the most suitable strike size (set via FT_Select_Size) and the ratio needed to scale that strike to the desired size (see GetBitmapAtlasScale and GetBitmapRenderScale). - AppendGlyphFlags has been updated to load color data (when available), and to only exclude bitmap data for fonts that also have scalable data. - FSlateFontRenderer::GetRenderDataInternal has been updated to handle color bitmap rendering (BGRA, sRGB) in addition to the existing grayscale rendering. - It will also handle scaling down bitmap font strikes that are larger than the desired size, which saves space in the atlas (see GetBitmapAtlasScale). - It won't scale up any bitmaps, as that is handled by the transform applied when batching the glyph quads for rendering (see GetBitmapRenderScale). - Added support for disabling outline and tint for bitmap fonts (in Slate and Canvas). - Added support for batching both grayscale (8-bit alpha-only) and color (8-bit per-channel BGRA) font quads from a font texture atlas (in RHI, D3D, and OpenGL). - Removed unused data from FCharacterRenderData. #jira #rb Matt.Kuhlenschmidt #ROBOMERGE-SOURCE: CL 8177432 via CL 8197318 #ROBOMERGE-BOT: (v401-8057353) [CL 8197520 by jamie dale in Main branch]
2019-08-21 17:23:59 -04:00
const FIntPoint AtlasSize = GetAtlasSize(InIsGrayscale);
const uint32 MaxFontTextureDimension = FMath::Min(AtlasSize.Y * 4u, GetMax2DTextureDimension()); // Don't allow textures greater than 4x our atlas size, but still honor the platform limit
Copying //UE4/Dev-Editor to Dev-Main (//UE4/Dev-Main) #lockdown nick.penwarden Change 2889481 on 2016/03/02 by Richard.TalbotWatkin Fixed socket preview component in Static Mesh Editor so that it remains correctly attached if the socket is renamed (Contributed by Manny-MADE). PR #2094 #jira UE-27338 - GitHub 2094 : BUGFIX: Socket preview component broken in Static Mesh Editor FSlateAtlasedTextureResource Made changes to the Perforce source control provider so that operations can be cancelled with immediate effect if there is an issue connecting to the server. #jira UE-24632 - "Updating file(s) source control status..." dialog doesn't allow Cancel #RB Thomas.Sarkanen Change 2890359 on 2016/03/02 by Nick.Darnell Jira Mirroring - Adding some tools for matching gits sha to perforce commits. Also adding the program for scraping jira issues and pushing them elsewhere. Change 2892008 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2813475 Change 2892086 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2813457 Change 2892117 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2812830 Change 2892316 on 2016/03/03 by Richard.TalbotWatkin Fixed conversion of brushes to volumes so that the original transform isn't lost. #jira UE-24404 - Convert Actor from BSP to volume can affect the actor transform Change 2892765 on 2016/03/03 by Andrew.Rodham Changed public facing level editor classes to use ILevelEditor instead of SLevelEditor #codereview Mike.Fricker Change 2894154 on 2016/03/04 by Richard.TalbotWatkin Fixed error in USplineComponent::GetSegmentLength when the segment is linear or constant. Change 2894481 on 2016/03/04 by Cody.Albert #jira UE-27830 Fixed mismatched layout name Change 2896339 on 2016/03/06 by Richard.TalbotWatkin Fixed undo issues in texture paint mode. #jira UE-21206 - Texture Painting bugs Change 2896713 on 2016/03/07 by Joe.Conley Replacing #ifndef with #pragma once Change 2896955 on 2016/03/07 by Cody.Albert #jira UE-27711 Added initialization for LastHighlightInteractionTime Change 2898895 on 2016/03/08 by Richard.TalbotWatkin More optimizations to editing actors with a large number of components. Improved performance when executing construction scripts. #jira UE-24821 - Blueprints with thousands of components perform very badly when selected in the Level Viewport Change 2900770 on 2016/03/09 by Joe.Conley Change #ifndef to #pragma once for headers under Runtime/Engine/Public Change 2900835 on 2016/03/09 by Richard.TalbotWatkin Fixed issues with scrolling items into view in STileView. Also fixed bugs in STileView::ReGenerateItems. #jira UE-20441 - Hitting F2 to rename an asset in the Content Browser moves the asset out of view if the CB is at default size and location #jira UE-20807 - Browse to Asset in Content Browser focuses just on the text #codereview Nick.Atamas Change 2900837 on 2016/03/09 by Richard.TalbotWatkin Added an OnKeyDownHandler to SSearchBox and SAssetSearchBox so that functionality for handling keypresses which is normally handled by SEditableText can be overridden. Added custom behavior to SAssetPicker and SAssetSearchBox so that up/down cursor keys can be used to change focus from the text box to the menu. #jira UE-20567 - UX Regression on Open Asset Panel This also addresses a similar issue with the auto-complete popup in the Content Browser search bar. Change 2900847 on 2016/03/09 by Richard.TalbotWatkin Fixed include dependency. Change 2900951 on 2016/03/09 by Richard.TalbotWatkin Fixed non-dependent name lookup for superclass member access. Change 2901325 on 2016/03/09 by Jamie.Dale PR #2107: Output Log Filtering (Contributed by phoboz-net) Change 2901391 on 2016/03/09 by Jamie.Dale Some more output log filter improvements We now defer the search until you finish typing, and the filter list itself now uses toggle buttons (like the content browser) so that you can toggle multiple filters without having to re-open the menu. Change 2901736 on 2016/03/09 by Alexis.Matte #jira UE-14632 Export staticmeshactor which are base on blueprint class as a blueprint instead of exporting it as an actor. #codereview nick.darnell Change 2903162 on 2016/03/10 by Alexis.Matte Fbx scene importer, Fix crash when changing the material base path in the material tab page #codereview nick.darnell Change 2903903 on 2016/03/10 by Richard.TalbotWatkin Fixed crash when attempting to paste an object from the level viewport into the content browser. #jira UE-26100 - Crash when attempting to copy an object from the world into the content browser Change 2903947 on 2016/03/10 by Richard.TalbotWatkin [CL 2937134 by Nick Darnell in Main branch]
2016-04-07 16:16:52 -04:00
if (InWidth <= MaxFontTextureDimension && InHeight <= MaxFontTextureDimension)
{
Added support for rendering TTF/OTF fonts containing bitmaps, including color fonts (like Emoji) Note: Bitmap fonts require FreeType 2.10, and support is compiled out if using an older version. Font Rendering: - ApplySizeAndScale now computes the desired pixel size manually (using our desired DPI) rather than calling FT_Set_Char_Size. - This also includes the font scale, which avoids the call to FT_Set_Transform and lets us remove some workarounds for inconsistent scaling from FreeType. - For scalable fonts the desired pixel size is passed to FT_Set_Pixel_Sizes. - For bitmap fonts the desired pixel size is used to find the most suitable strike size (set via FT_Select_Size) and the ratio needed to scale that strike to the desired size (see GetBitmapAtlasScale and GetBitmapRenderScale). - AppendGlyphFlags has been updated to load color data (when available), and to only exclude bitmap data for fonts that also have scalable data. - FSlateFontRenderer::GetRenderDataInternal has been updated to handle color bitmap rendering (BGRA, sRGB) in addition to the existing grayscale rendering. - It will also handle scaling down bitmap font strikes that are larger than the desired size, which saves space in the atlas (see GetBitmapAtlasScale). - It won't scale up any bitmaps, as that is handled by the transform applied when batching the glyph quads for rendering (see GetBitmapRenderScale). - Added support for disabling outline and tint for bitmap fonts (in Slate and Canvas). - Added support for batching both grayscale (8-bit alpha-only) and color (8-bit per-channel BGRA) font quads from a font texture atlas (in RHI, D3D, and OpenGL). - Removed unused data from FCharacterRenderData. #jira #rb Matt.Kuhlenschmidt #ROBOMERGE-SOURCE: CL 8177432 via CL 8197318 #ROBOMERGE-BOT: (v401-8057353) [CL 8197520 by jamie dale in Main branch]
2019-08-21 17:23:59 -04:00
return MakeShareable(new FSlateFontTextureRHI(InWidth, InHeight, InIsGrayscale, InRawData));
Copying //UE4/Dev-Editor to Dev-Main (//UE4/Dev-Main) #lockdown nick.penwarden Change 2889481 on 2016/03/02 by Richard.TalbotWatkin Fixed socket preview component in Static Mesh Editor so that it remains correctly attached if the socket is renamed (Contributed by Manny-MADE). PR #2094 #jira UE-27338 - GitHub 2094 : BUGFIX: Socket preview component broken in Static Mesh Editor FSlateAtlasedTextureResource Made changes to the Perforce source control provider so that operations can be cancelled with immediate effect if there is an issue connecting to the server. #jira UE-24632 - "Updating file(s) source control status..." dialog doesn't allow Cancel #RB Thomas.Sarkanen Change 2890359 on 2016/03/02 by Nick.Darnell Jira Mirroring - Adding some tools for matching gits sha to perforce commits. Also adding the program for scraping jira issues and pushing them elsewhere. Change 2892008 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2813475 Change 2892086 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2813457 Change 2892117 on 2016/03/03 by Richard.TalbotWatkin Back out changelist 2812830 Change 2892316 on 2016/03/03 by Richard.TalbotWatkin Fixed conversion of brushes to volumes so that the original transform isn't lost. #jira UE-24404 - Convert Actor from BSP to volume can affect the actor transform Change 2892765 on 2016/03/03 by Andrew.Rodham Changed public facing level editor classes to use ILevelEditor instead of SLevelEditor #codereview Mike.Fricker Change 2894154 on 2016/03/04 by Richard.TalbotWatkin Fixed error in USplineComponent::GetSegmentLength when the segment is linear or constant. Change 2894481 on 2016/03/04 by Cody.Albert #jira UE-27830 Fixed mismatched layout name Change 2896339 on 2016/03/06 by Richard.TalbotWatkin Fixed undo issues in texture paint mode. #jira UE-21206 - Texture Painting bugs Change 2896713 on 2016/03/07 by Joe.Conley Replacing #ifndef with #pragma once Change 2896955 on 2016/03/07 by Cody.Albert #jira UE-27711 Added initialization for LastHighlightInteractionTime Change 2898895 on 2016/03/08 by Richard.TalbotWatkin More optimizations to editing actors with a large number of components. Improved performance when executing construction scripts. #jira UE-24821 - Blueprints with thousands of components perform very badly when selected in the Level Viewport Change 2900770 on 2016/03/09 by Joe.Conley Change #ifndef to #pragma once for headers under Runtime/Engine/Public Change 2900835 on 2016/03/09 by Richard.TalbotWatkin Fixed issues with scrolling items into view in STileView. Also fixed bugs in STileView::ReGenerateItems. #jira UE-20441 - Hitting F2 to rename an asset in the Content Browser moves the asset out of view if the CB is at default size and location #jira UE-20807 - Browse to Asset in Content Browser focuses just on the text #codereview Nick.Atamas Change 2900837 on 2016/03/09 by Richard.TalbotWatkin Added an OnKeyDownHandler to SSearchBox and SAssetSearchBox so that functionality for handling keypresses which is normally handled by SEditableText can be overridden. Added custom behavior to SAssetPicker and SAssetSearchBox so that up/down cursor keys can be used to change focus from the text box to the menu. #jira UE-20567 - UX Regression on Open Asset Panel This also addresses a similar issue with the auto-complete popup in the Content Browser search bar. Change 2900847 on 2016/03/09 by Richard.TalbotWatkin Fixed include dependency. Change 2900951 on 2016/03/09 by Richard.TalbotWatkin Fixed non-dependent name lookup for superclass member access. Change 2901325 on 2016/03/09 by Jamie.Dale PR #2107: Output Log Filtering (Contributed by phoboz-net) Change 2901391 on 2016/03/09 by Jamie.Dale Some more output log filter improvements We now defer the search until you finish typing, and the filter list itself now uses toggle buttons (like the content browser) so that you can toggle multiple filters without having to re-open the menu. Change 2901736 on 2016/03/09 by Alexis.Matte #jira UE-14632 Export staticmeshactor which are base on blueprint class as a blueprint instead of exporting it as an actor. #codereview nick.darnell Change 2903162 on 2016/03/10 by Alexis.Matte Fbx scene importer, Fix crash when changing the material base path in the material tab page #codereview nick.darnell Change 2903903 on 2016/03/10 by Richard.TalbotWatkin Fixed crash when attempting to paste an object from the level viewport into the content browser. #jira UE-26100 - Crash when attempting to copy an object from the world into the content browser Change 2903947 on 2016/03/10 by Richard.TalbotWatkin [CL 2937134 by Nick Darnell in Main branch]
2016-04-07 16:16:52 -04:00
}
}
return nullptr;
}
private:
/** Size of each font texture, width and height */
Added support for rendering TTF/OTF fonts containing bitmaps, including color fonts (like Emoji) Note: Bitmap fonts require FreeType 2.10, and support is compiled out if using an older version. Font Rendering: - ApplySizeAndScale now computes the desired pixel size manually (using our desired DPI) rather than calling FT_Set_Char_Size. - This also includes the font scale, which avoids the call to FT_Set_Transform and lets us remove some workarounds for inconsistent scaling from FreeType. - For scalable fonts the desired pixel size is passed to FT_Set_Pixel_Sizes. - For bitmap fonts the desired pixel size is used to find the most suitable strike size (set via FT_Select_Size) and the ratio needed to scale that strike to the desired size (see GetBitmapAtlasScale and GetBitmapRenderScale). - AppendGlyphFlags has been updated to load color data (when available), and to only exclude bitmap data for fonts that also have scalable data. - FSlateFontRenderer::GetRenderDataInternal has been updated to handle color bitmap rendering (BGRA, sRGB) in addition to the existing grayscale rendering. - It will also handle scaling down bitmap font strikes that are larger than the desired size, which saves space in the atlas (see GetBitmapAtlasScale). - It won't scale up any bitmaps, as that is handled by the transform applied when batching the glyph quads for rendering (see GetBitmapRenderScale). - Added support for disabling outline and tint for bitmap fonts (in Slate and Canvas). - Added support for batching both grayscale (8-bit alpha-only) and color (8-bit per-channel BGRA) font quads from a font texture atlas (in RHI, D3D, and OpenGL). - Removed unused data from FCharacterRenderData. #jira #rb Matt.Kuhlenschmidt #ROBOMERGE-SOURCE: CL 8177432 via CL 8197318 #ROBOMERGE-BOT: (v401-8057353) [CL 8197520 by jamie dale in Main branch]
2019-08-21 17:23:59 -04:00
int32 GrayscaleAtlasSize;
int32 ColorAtlasSize;
};
/**
* Implements the Slate RHI Renderer module.
*/
class FSlateRHIRendererModule
: public ISlateRHIRendererModule
{
public:
// ISlateRHIRendererModule interface
virtual TSharedRef<FSlateRenderer> CreateSlateRHIRenderer( ) override
{
ConditionalCreateResources();
return MakeShareable( new FSlateRHIRenderer( SlateFontServices.ToSharedRef(), ResourceManager.ToSharedRef() ) );
}
Copying //UE4/Dev-Editor to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2756103 on 2015/11/05 by Jamie.Dale Implemented UFont::GetResourceSize to work correctly with the Size Map tool Change 2756104 on 2015/11/05 by Jamie.Dale Changed the font used when a font is missing or invalid to be the last resort font, rather than the localized fallback font The localized fallback font could cause different results based on your culture, and the last resort font makes it clearer that something is set-up incorrectly as it just draws invalid glyph markers for all of the text. Change 2756105 on 2015/11/05 by Jamie.Dale Fixed a crash when using an empty FKey property with a Data Table FKeyStructCustomization was asserting because there were no objects being edited, due to a newly added Data Table containing zero rows. I've removed this assert, and also updated SKeySelector to no longer require a separate argument to say whether multiple keys with different values are selected (this is now calculated from the call to get the current key, which will return an empty TOptional for multiple values). #jira UE-22897 Change 2757015 on 2015/11/06 by Joe.Tidmarsh SSProgressBar marquee tint. Accounts for widget color and opacity. PR #1698 Change 2757156 on 2015/11/06 by Joe.Tidmarsh Implemented "Go to Variable" functionality for widgets in Widget Blueprint Editor. When we switch modes in UMG from Designer to Graph. We select the variable (In "My Blueprint"), if one exists, for the currently selected widget. Additionally we update the details panel. * Added SelectGraphActionItemByName to FBlueprintEditor. This selects an item in My Blueprint and also displays it in the details panel of graph mode. SMyBlueprint is not available to FWidgetBlueprintEditor in UMGEditor module as it's privately implemented within Kismet. #rb Ben.Cosh #jira UE-20170 Change 2757181 on 2015/11/06 by Jamie.Dale Cleaned up some duplication in UMG text widgets, and exposed the text shaping options The common properties used by all text widgets that are text layout based have been moved into a UTextLayoutWidget base class, and all text layout based widgets now derive from this. The options needed to control the text shaping method used by a text based widget have been exposed via the FShapedTextOptions struct. This contains a way to manage these optional (and advanced) overrides. You typically wouldn't change these from the default unless you knew exactly what you were doing (eg, you have a text block containing only numbers). This change also updates SRichTextBlock to work with an invalidation panel in the same way that STextBlock does Change 2757734 on 2015/11/06 by David.Nikdel #UE4 #Editor - Added support for meta=(TitleProperty="StructPropertyNameHere") on properties of type TArray<FSomeStruct>. - This changes the editor rolled-up display of these values from "{0} members" to a stringified version of the specified property (if found). #CodeReview: Matt.Kuhlenschmidt Change 2758786 on 2015/11/09 by Joe.Tidmarsh Border widget now correctly synchronizes padding property #jira UE-23070 Change 2758791 on 2015/11/09 by Joe.Tidmarsh Shadow of FCanvasTextItem should be drawn before the outline color. Consulted with Bruce.N who believes this is not the intended behavior and was an oversight when refactoring FCanvas (CL 1695138) #jira UE-21623 #1608 #rb Simon.Tovey, Bruce.Nesbit Change 2758813 on 2015/11/09 by Joe.Tidmarsh UMG: Attempting to parent multiple widgets (in Hierarchy tree) to a widget that can't have multiple children will notify the user and ignore the operation. [UE-22921] [CrashReport] Parenting multiple actors under border crashes editor #jira UE-22921 Change 2759234 on 2015/11/09 by Nick.Darnell Slate - Improving the way we track references to materials in slate to better keep things alive until they're no longer needed for rendering. Additionally, making it so the we use the material and texture free list when possible when cleaning up things as to not allocate new memory if not required. Concidentually this can help with problems with corrupted memory on destruct as well, because it means the memory isn't really going to become garbage any more. #codereview Matt.Kuhlenschmidt, Bob.Tellez Change 2760954 on 2015/11/10 by Nick.Darnell Slate - A bug in the introduction of custom rendered elements accidentally broke filling out the texture coordinates for standard material usage. Materials should once again tile correctly just like images do. #jira UE-23118 Change 2761129 on 2015/11/10 by Nick.Darnell Slate - Removing the Pre-Multiply alpha path the way it was added, introducing it in a way that doesn't require changes inside the shader. Continuing to improve the SRetainerWidget to no longer have a frame delay between resizes and painting, also working on getting it handle clipping correctly but still not there yet. Change 2761391 on 2015/11/10 by Alexis.Matte jira UE-20281 and UE-22259 Fbx scene Re-import workflow - First draft of the reimport workflow using a reimport asset in the content browser #codereview nick.darnell Change 2762323 on 2015/11/11 by Alexis.Matte fix build compilation Change 2762407 on 2015/11/11 by Jamie.Dale UDataTable::SaveStructData now writes out dummy data when RowStruct is null This didn't used to happen, which would cause a miss-match between what UDataTable::LoadStructData was expecting, and would result in a Data Table that could never be loaded again. This change also improves the error message when editing a Data Table with a null row struct, and adds the editor-only RowStructName property to cache the name of the last used struct (for error reporting). #jira UE-22789 Change 2762508 on 2015/11/11 by Nick.Darnell UMG - Making it more obvious what keys do special stuff with anchors in UMG. Fixing the way snapping to anchors works with Control, it now only zeros out the side you're dragging instead of the entire widget, which was silly. Enhancing the designer message system to no longer be based on an enum and instead let arbitrary systems push and pop FText messages. Fixing animations in the anchor drop down to properly animate, broke when we introduced active timers. Change 2763241 on 2015/11/11 by Nick.Darnell Slate - We no longer allow popup windows to be larger than the primary display window for windows where max width/height is unspecified. This is to prevent accidential creation of tooltip windows that are larger than the driver allows causing crashes. #jira UE-20336
2015-12-12 08:54:23 -05:00
virtual TSharedRef<ISlate3DRenderer, ESPMode::ThreadSafe> CreateSlate3DRenderer(bool bUseGammaCorrection) override
{
ConditionalCreateResources();
Merging //UE4/Release-4.11 to //UE4/Main (Up to CL#2897738) ========================== MAJOR FEATURES + CHANGES ========================== Change 2875445 on 2016/02/22 by Matthew.Griffin Added UE4.natvis to Visual Studio Projects #jira UE-27153 Change 2875456 on 2016/02/22 by Keith.Judge Fix custom stencil shaders on Xbox One #jira UES-1387 Change 2875524 on 2016/02/22 by Robert.Manuszewski More log info when saving shader temp files fails. Increased the number of attemps when moving a file fails. #jira UE-20945 Change 2875698 on 2016/02/22 by Rolando.Caloca UE4.11 - Add new bool for RHIs (unused currently) #jira UE-24967 Change 2875897 on 2016/02/22 by Taizyd.Korambayil #jira UE-20324 Re-imported Cloth Skeletal Meshes to Fix odd Circle Highlights Change 2875922 on 2016/02/22 by Mieszko.Zielinski Fixed BP-implemented EQS generators crashing when trying to add generated value of wrong type #UE4 #jira UE-25034 #rb Lukasz.Furman Change 2875960 on 2016/02/22 by Michael.Trepka Added a way to disable right click emulation on Mac and used it in TabNavigator to fix issues with its widgets not reacting to clicking #jira UE-21895 Change 2875984 on 2016/02/22 by Michael.Schoell Split output struct pins will no longer give a warning about override pins being removed. #jira UE-27150 - Format Text nodes and split nodes reporting warning that override pins are removed. Change 2876169 on 2016/02/22 by Ben.Marsh Changes to support building UHT plugins with the binary release. * Add source code and target files for UHT to binary distribution * Fix UBT deleting build products if we're only compiling a single module. * Fix UBT exception setting up compile environment when a module doesn't have any source files set to build. * Include DLL import libraries for UHT in the build * Add support for compiling UHT modules in BuildPluginCommand. Stages an empty host project to allow UHT to load any enabled plugins. Change 2876219 on 2016/02/22 by Rolando.Caloca UE4.11 - Integration from 2874609 #jira UE-24967 PC: Update D3D12 RHI - Implement _RenderThread versions of Create, Lock and Unlock Index/Vertex Buffer. Only synchronize threads on Readback - Limit GPU starvation on CPU bound scenarios by flushing work when the GPU is idle - Change texture streaming system to correctly account for placed textures. Also fix texture sizes so they accurately represent the real size of the allocation the GPU. - Disable API shader blobs - Add the ability to easily change allocation stategy for a given pool, also add a simple linear allocator and a 'Multi-Buddy Allocator' for efficiency in different scenarios - Pool Fences to prevent creation and destruction every frame when using Async Compute - Implement _RenderThread versions of CreateShaderResourceView and CreateUnorderedAccessView Change 2876232 on 2016/02/22 by Rolando.Caloca UE4.11 - Integration from 2876173 #jira UE-24967 PC: Update D3D12 RHI - Fix ResizeBuffers() failing due to dangling references to the backbuffer if deferred deletion is used. - Reorder when pending FRHIResources are deleted. This still needs to flush all pending deletes and ignore the deferred deletion queue otherwise some items may still be left in the engine's queue. - Fix UT build error due to missing FPlatformMisc::GetGPUDriverInfo() Change 2876366 on 2016/02/22 by Douglas.Copeland Adding Skeletal Meshes for Import Test Case #jira UE-24473 Change 2876401 on 2016/02/22 by Peter.Sauerbrei fix for WindowsClient build from UFE and Project Launcher #jira UE-23897 Change 2876456 on 2016/02/22 by Ben.Marsh Use a more hierarchical directory structure for packaged builds, rather than just dumping everything in the root. Now defaults to <Share>\\PackagedBuilds\\<Branch>\\<CL>\\<ProjectName>_<Platform>_<Configuration>. Change 2876507 on 2016/02/22 by Nick.Shin use HOME (osx) and USERPROFILE (windows) on appropriate target platform #jira UE-26414 -- Mac is missing .emscripten file necessary for packaging or launching onto HTML5 Change 2876537 on 2016/02/22 by Dan.Oconnor Removed dubious fix for an old bug, no longer needed but I havn't figured out what has changed. This fixes a crash on Replace References, but does not reintroduce UE-9497 #jira UE-24891 Change 2876545 on 2016/02/22 by Chad.Taylor SteamVR camera late-update fix #jira UE-27254 Change 2876825 on 2016/02/22 by Dan.Oconnor Unfortunate edge case in lifetime of UEdGraph's schema, schema is assigned after construction so its modification is in the undo buffer, and we clear it after undoing. #jira UE-25956 Change 2876878 on 2016/02/22 by Nick.Whiting PSVR HMD Server support #jira UE-27262 [CL 2905127 by Matthew Griffin in Main branch]
2016-03-11 09:55:03 -05:00
return MakeShareable(new FSlate3DRenderer(SlateFontServices.ToSharedRef(), ResourceManager.ToSharedRef(), bUseGammaCorrection), [=] (FSlate3DRenderer* Renderer) {
Renderer->Cleanup();
});
}
virtual TSharedRef<ISlateFontAtlasFactory> CreateSlateFontAtlasFactory() override
{
return MakeShareable(new FSlateRHIFontAtlasFactory);
}
virtual TSharedRef<ISlateUpdatableInstanceBuffer> CreateInstanceBuffer( int32 InitialInstanceCount ) override
{
return MakeShareable( new FSlateUpdatableInstanceBuffer(InitialInstanceCount) );
}
virtual void StartupModule( ) override { }
virtual void ShutdownModule( ) override { }
private:
/** Creates resource managers if they do not exist */
void ConditionalCreateResources()
{
if( !ResourceManager.IsValid() )
{
ResourceManager = MakeShareable( new FSlateRHIResourceManager );
}
if( !SlateFontServices.IsValid() )
{
const TSharedRef<FSlateFontCache> GameThreadFontCache = MakeShareable(new FSlateFontCache(MakeShareable(new FSlateRHIFontAtlasFactory), ESlateTextureAtlasThreadId::Game));
const TSharedRef<FSlateFontCache> RenderThreadFontCache = MakeShareable(new FSlateFontCache(MakeShareable(new FSlateRHIFontAtlasFactory), ESlateTextureAtlasThreadId::Render));
SlateFontServices = MakeShareable(new FSlateFontServices(GameThreadFontCache, RenderThreadFontCache));
}
}
private:
/** Resource manager used for all renderers */
TSharedPtr<FSlateRHIResourceManager> ResourceManager;
/** Font services used for all renderers */
TSharedPtr<FSlateFontServices> SlateFontServices;
};
IMPLEMENT_MODULE( FSlateRHIRendererModule, SlateRHIRenderer )