app_server: remove GPU->GPU rect shifting code
It is not used anymore and is very slow on real hardware because it read GPU memory by CPU. Change-Id: I06f7ca072220b758d849921e844bb2aa75342e2c Reviewed-on: https://review.haiku-os.org/c/haiku/+/8680 Tested-by: Commit checker robot <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
@@ -1412,7 +1412,7 @@ DrawingEngine::CopyRect(BRect src, int32 xOffset, int32 yOffset) const
|
|||||||
uint32 width = src.IntegerWidth() + 1;
|
uint32 width = src.IntegerWidth() + 1;
|
||||||
uint32 height = src.IntegerHeight() + 1;
|
uint32 height = src.IntegerHeight() + 1;
|
||||||
|
|
||||||
_CopyRect(buffer->IsGraphicsMemory(), bits, width, height, bytesPerRow,
|
_CopyRect(bits, width, height, bytesPerRow,
|
||||||
xOffset, yOffset);
|
xOffset, yOffset);
|
||||||
|
|
||||||
// offset dest again, because it is return value
|
// offset dest again, because it is return value
|
||||||
@@ -1431,7 +1431,7 @@ DrawingEngine::SetRendererOffset(int32 offsetX, int32 offsetY)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DrawingEngine::_CopyRect(bool isGraphicsMemory, uint8* src, uint32 width, uint32 height,
|
DrawingEngine::_CopyRect(uint8* src, uint32 width, uint32 height,
|
||||||
uint32 bytesPerRow, int32 xOffset, int32 yOffset) const
|
uint32 bytesPerRow, int32 xOffset, int32 yOffset) const
|
||||||
{
|
{
|
||||||
// TODO: assumes drawing buffer is 32 bits (which it currently always is)
|
// TODO: assumes drawing buffer is 32 bits (which it currently always is)
|
||||||
@@ -1450,27 +1450,10 @@ DrawingEngine::_CopyRect(bool isGraphicsMemory, uint8* src, uint32 width, uint32
|
|||||||
uint8* dst = src + (ssize_t)yOffset * bytesPerRow + (ssize_t)xOffset * 4;
|
uint8* dst = src + (ssize_t)yOffset * bytesPerRow + (ssize_t)xOffset * 4;
|
||||||
|
|
||||||
if (!needMemmove) {
|
if (!needMemmove) {
|
||||||
if (!isGraphicsMemory) {
|
for (uint32 y = 0; y < height; y++) {
|
||||||
// NOTE: this (instead of the two pass copy below) might
|
memcpy(dst, src, width * 4);
|
||||||
// speed up QEMU -> ?!? (would depend on how it emulates
|
src += yIncrement;
|
||||||
// the PCI bus...)
|
dst += yIncrement;
|
||||||
for (uint32 y = 0; y < height; y++) {
|
|
||||||
memcpy(dst, src, width * 4);
|
|
||||||
src += yIncrement;
|
|
||||||
dst += yIncrement;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uint8 tmpBuffer[width * 4];
|
|
||||||
for (uint32 y = 0; y < height; y++) {
|
|
||||||
// NOTE: read into temporary scanline buffer,
|
|
||||||
// NOTE: **don't read and write over the PCI bus
|
|
||||||
// at the same time**
|
|
||||||
memcpy(tmpBuffer, src, width * 4);
|
|
||||||
// write back temporary scanline buffer
|
|
||||||
memcpy(dst, tmpBuffer, width * 4);
|
|
||||||
src += yIncrement;
|
|
||||||
dst += yIncrement;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (uint32 y = 0; y < height; y++) {
|
for (uint32 y = 0; y < height; y++) {
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
friend class DrawTransaction;
|
friend class DrawTransaction;
|
||||||
|
|
||||||
void _CopyRect(bool isGraphicsMemory, uint8* bits,
|
void _CopyRect(uint8* bits,
|
||||||
uint32 width, uint32 height, uint32 bytesPerRow,
|
uint32 width, uint32 height, uint32 bytesPerRow,
|
||||||
int32 xOffset, int32 yOffset) const;
|
int32 xOffset, int32 yOffset) const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user