20 #include "pedigree/kernel/graphics/Graphics.h" 21 #include "pedigree/kernel/Log.h" 22 #include "pedigree/kernel/machine/Framebuffer.h" 23 #include "pedigree/kernel/utilities/new" 26 Framebuffer *pParent,
size_t x,
size_t y,
size_t w,
size_t h,
35 if ((x > pParent->getWidth()) || (y > pParent->getHeight()))
40 Graphics::PixelFormat format = pParent->getFormat();
42 size_t bytesPerPixel = pParent->getBytesPerPixel();
43 size_t bytesPerLine = bytesPerPixel * w;
48 pMem =
new uint8_t[bytesPerLine * h];
50 pMem =
reinterpret_cast<uint8_t *
>(pFbOverride);
52 "pMem: " << reinterpret_cast<uintptr_t>(pMem)
53 <<
" ov=" << (pFbOverride ?
"yes" :
"no"));
57 pRet->setFramebuffer(reinterpret_cast<uintptr_t>(pMem));
60 pRet->setFormat(format);
61 pRet->setBytesPerPixel(bytesPerPixel);
62 pRet->setBytesPerLine(bytesPerLine);
69 void Graphics::destroyFramebuffer(
Framebuffer *pFramebuffer)
75 if (pFramebuffer->getParent())
77 0, 0, pFramebuffer->getWidth(), pFramebuffer->getHeight(),
false);
virtual void * getRawBuffer() const
Framebuffer * m_pParent
Parent of this framebuffer.
void redraw(size_t x=~0UL, size_t y=~0UL, size_t w=~0UL, size_t h=~0UL, bool bChild=false)
Abstracts the system's framebuffer offering.