Initial phase of UI Canvas Editor rendering with Atom (#164)
* Move Draw2d.h to Include folder * Initial phase of UI Canvas Editor rendering with Atom * Simplify Draw2d by removing BeginDraw2d/EndDraw2d which is no longer needed * Fix compile errors for non-unity builds
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
#include "LyShine_precompiled.h"
|
||||
#include "UiCanvasManager.h"
|
||||
#include <LyShine/Draw2d.h>
|
||||
|
||||
#include "UiCanvasFileObject.h"
|
||||
#include "UiCanvasComponent.h"
|
||||
@@ -33,6 +34,8 @@
|
||||
#include <LyShine/Bus/World/UiCanvasOnMeshBus.h>
|
||||
#include <LyShine/Bus/World/UiCanvasRefBus.h>
|
||||
|
||||
#include <Atom/RPI.Public/Image/ImageSystemInterface.h>
|
||||
|
||||
#ifndef _RELEASE
|
||||
#include <AzFramework/IO/LocalFileIO.h>
|
||||
#endif
|
||||
@@ -998,16 +1001,15 @@ void UiCanvasManager::DebugDisplayCanvasData(int setting) const
|
||||
{
|
||||
bool onlyShowEnabledCanvases = (setting == 2) ? true : false;
|
||||
|
||||
IDraw2d* draw2d = Draw2dHelper::GetDraw2d();
|
||||
|
||||
draw2d->BeginDraw2d(false);
|
||||
CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d();
|
||||
|
||||
float xOffset = 20.0f;
|
||||
float yOffset = 20.0f;
|
||||
|
||||
const int elementNameFieldLength = 20;
|
||||
|
||||
int blackTexture = gEnv->pRenderer->GetBlackTextureId();
|
||||
auto blackTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Black);
|
||||
|
||||
float textOpacity = 1.0f;
|
||||
float backgroundRectOpacity = 0.75f;
|
||||
|
||||
@@ -1152,21 +1154,17 @@ void UiCanvasManager::DebugDisplayCanvasData(int setting) const
|
||||
totalEnabledIntrs, totalEnabledUpdates);
|
||||
|
||||
WriteLine(buffer, red);
|
||||
|
||||
draw2d->EndDraw2d();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void UiCanvasManager::DebugDisplayDrawCallData() const
|
||||
{
|
||||
IDraw2d* draw2d = Draw2dHelper::GetDraw2d();
|
||||
|
||||
draw2d->BeginDraw2d(false);
|
||||
CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d();
|
||||
|
||||
float xOffset = 20.0f;
|
||||
float yOffset = 20.0f;
|
||||
|
||||
int blackTexture = gEnv->pRenderer->GetBlackTextureId();
|
||||
auto blackTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Black);
|
||||
float textOpacity = 1.0f;
|
||||
float backgroundRectOpacity = 0.75f;
|
||||
const float lineSpacing = 20.0f;
|
||||
@@ -1293,8 +1291,6 @@ void UiCanvasManager::DebugDisplayDrawCallData() const
|
||||
totalDueToMaxVerts, totalDueToTextures);
|
||||
|
||||
WriteLine(buffer, red);
|
||||
|
||||
draw2d->EndDraw2d();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1492,9 +1488,7 @@ void UiCanvasManager::DebugReportDrawCalls(const AZStd::string& name) const
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void UiCanvasManager::DebugDisplayElemBounds(int canvasIndexFilter) const
|
||||
{
|
||||
IDraw2d* draw2d = Draw2dHelper::GetDraw2d();
|
||||
|
||||
draw2d->BeginDraw2d(false);
|
||||
CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d();
|
||||
|
||||
int canvasIndex = 0;
|
||||
for (auto canvas : m_loadedCanvases)
|
||||
@@ -1515,8 +1509,6 @@ void UiCanvasManager::DebugDisplayElemBounds(int canvasIndexFilter) const
|
||||
|
||||
++canvasIndex; // only increments for enabled canvases so index matches "ui_DisplayCanvasData 2"
|
||||
}
|
||||
|
||||
draw2d->EndDraw2d();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user