summaryrefslogtreecommitdiffhomepage
path: root/dev/Modules
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-11-23 08:44:49 +0100
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-11-23 08:44:49 +0100
commitd2d6b4cb728e3e80c10d6e3bbd72e6f7b3dfea9b (patch)
treee89d365c779deee749136f6373e4759df160453f /dev/Modules
parent083b0ee668f217ddc0462d5d7b62d53bc1a2756b (diff)
META: Morning bump.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/Modules')
-rw-r--r--dev/Modules/FB/WS.h24
-rw-r--r--dev/Modules/WSGL/WSGL.h26
2 files changed, 42 insertions, 8 deletions
diff --git a/dev/Modules/FB/WS.h b/dev/Modules/FB/WS.h
index d8c5c991..60c7a78c 100644
--- a/dev/Modules/FB/WS.h
+++ b/dev/Modules/FB/WS.h
@@ -7,18 +7,21 @@
#pragma once
#include <ArchKit/ArchKit.h>
-#include <Modules/FB/FB.h>
-#include <Modules/FB/Text.h>
#include <NewKit/Utils.h>
/// @file WS.h
-/// @brief WindowServer's endpoint implementation. (within the zka-dev subsystem)
+/// @brief WindowServer's window ownership implementation.
+/// It is used to draw within a window.
+
+#define rtl_allocate_backbuffer(width, height) new WS::WSBackBufferKind[width * height]
+#define rtl_compute_fb_geometry(width, height) (width * height)
namespace WS
{
using namespace Kernel;
- struct WSWindowContainer;
+ class WSWindowTexture;
+ class WSWindowContainer;
typedef UInt32* WSBackBufferKind;
@@ -31,7 +34,7 @@ namespace WS
ZKA_COPY_DEFAULT(WSWindowContainer);
/// @note the trick is, it could be GPU processed data, that's the cool thing.
- BOOL PopulateWindow(WSBackBufferKind contents_buf, SizeT contents_len)
+ BOOL Fill(WSBackBufferKind contents_buf, SizeT contents_len)
{
if (contents_len > BackBufferLength)
return NO;
@@ -47,11 +50,16 @@ namespace WS
return YES;
}
+ BOOL Fill(WSWindowContainer* container)
+ {
+ if (!container)
+ return NO;
+
+ return this->Fill(container->BackBuffer, container->BackBufferLength);
+ }
+
public:
WSBackBufferKind BackBuffer{nullptr};
SizeT BackBufferLength{0UL};
};
} // namespace WS
-
-#define rtl_allocate_backbuffer(width, height) new WS::WSBackBufferKind[width * height]
-#define rtl_compute_fb_geometry(width, height) (width * height)
diff --git a/dev/Modules/WSGL/WSGL.h b/dev/Modules/WSGL/WSGL.h
index 47bf402f..59cf6f5c 100644
--- a/dev/Modules/WSGL/WSGL.h
+++ b/dev/Modules/WSGL/WSGL.h
@@ -7,3 +7,29 @@
#pragma once
#include <NewKit/Defines.h>
+#include <Modules/FB/WS.h>
+
+namespace WS
+{
+ /// @brief GPU texture class.
+ class WSWindowTexture final
+ {
+ public:
+ explicit WSWindowTexture() = default;
+ ~WSWindowTexture() = default;
+
+ ZKA_COPY_DEFAULT(WSWindowTexture);
+
+ VoidPtr InputData{nullptr};
+ VoidPtr ProcessUnit{nullptr};
+ BOOL* IsDone{nullptr};
+
+ const BOOL TryIsDone()
+ {
+ if (IsDone && *IsDone)
+ return YES;
+
+ return NO;
+ }
+ };
+} // namespace WS