[Phi] adding foundations for image blitting
Mirror Gitea refs to GitHub / mirror (push) Successful in 12s
Test / build_and_test (push) Successful in 5m58s
Build / build (push) Successful in 7m26s

This commit is contained in:
2026-08-20 16:12:15 +02:00
parent b9c12eb599
commit 1fe3bacbee
9 changed files with 332 additions and 18 deletions
+20 -13
View File
@@ -1,6 +1,8 @@
#include "Commands.h"
#include <stddef.h>
#include <stdint.h>
#include <Blitter.h>
#include <Image.h>
#include <Logger.h>
#include <Memory.h>
@@ -331,18 +333,6 @@ static PhiStatus CopyImageRegion(const PhiCmdCopyImage* command)
return PHI_STATUS_OK;
}
static PhiStatus ExecuteCopyImage(PhiCommandReader* reader)
{
PhiCmdCopyImage command;
PhiStatus status = ReadCommandData(reader, &command, sizeof(command));
if(status != PHI_STATUS_OK)
return status;
return CopyImageRegion(&command);
}
int IsImageCommand(const PhiCmdHeader* header)
{
switch((PhiCmdType)header->type)
@@ -350,6 +340,7 @@ int IsImageCommand(const PhiCmdHeader* header)
case PHI_CMD_COPY_BUFFER_TO_IMAGE:
case PHI_CMD_COPY_IMAGE_TO_BUFFER:
case PHI_CMD_COPY_IMAGE:
case PHI_CMD_BLIT_IMAGE:
return 1;
default:
@@ -364,7 +355,23 @@ PhiStatus ExecuteImageCommand(PhiCommandReader* reader, const PhiCmdHeader* head
case PHI_CMD_COPY_BUFFER_TO_IMAGE:
case PHI_CMD_COPY_IMAGE_TO_BUFFER:
case PHI_CMD_COPY_IMAGE:
return ExecuteCopyImage(reader);
{
PhiCmdCopyImage command;
PhiStatus status = ReadCommandData(reader, &command, sizeof(command));
if(status != PHI_STATUS_OK)
return status;
return CopyImageRegion(&command);
}
case PHI_CMD_BLIT_IMAGE:
{
PhiCmdBlitImage command;
PhiStatus status = ReadCommandData(reader, &command, sizeof(command));
if(status != PHI_STATUS_OK)
return status;
return BlitImage(&command);
}
default:
return PHI_STATUS_BAD_MESSAGE;