[Phi] adding foundations for image blitting
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#include <Blitter.h>
|
||||
#include <Memory.h>
|
||||
|
||||
PhiStatus BlitImage(const PhiCmdBlitImage* command)
|
||||
{
|
||||
const Memory* src_memory = (const Memory*)(uintptr_t)command->src_memory;
|
||||
Memory* dst_memory = (Memory*)(uintptr_t)command->dst_memory;
|
||||
|
||||
for(uint32_t layer = 0; layer < command->layer_count; ++layer)
|
||||
{
|
||||
}
|
||||
|
||||
return PHI_STATUS_OK;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#define APE_PHI_BLITTER_H
|
||||
#ifndef APE_PHI_BUFFER_H
|
||||
|
||||
#include <Commands.h>
|
||||
#include <Protocol.h>
|
||||
|
||||
PhiStatus BlitImage(const PhiCmdBlitImage* command);
|
||||
|
||||
#endif
|
||||
+20
-13
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user