cleaned up BlitRow()

This commit is contained in:
Lars Doucet
2017-03-22 20:22:08 -05:00
committed by Joshua Granick
parent 580946913a
commit 71ab0b6e17
3 changed files with 11 additions and 13 deletions

View File

@@ -97,13 +97,7 @@ namespace lime {
}
void ImageBuffer::BlitRow (const unsigned char *data, int sourcePosition, int destPosition, int sourceW, int destX, int destY) {
if (destX < 0 || destX + sourceW > this->width || destY < 0 || destY + 1 > this->height) {
return;
}
void ImageBuffer::BlitRow (const unsigned char *data, int sourcePosition, int destPosition, int sourceW) {
int stride = (sourceW * (((bitsPerPixel + 3) & ~0x3) >> 3));

View File

@@ -129,12 +129,16 @@ namespace lime {
if(sourceFormat == destFormat && sourcePremultiplied == destPremultiplied) {
for (int y = 0; y < destView.height; y++) {
if (false == (destView.x < 0 || destView.x + sourceView.width > image->width || destView.y < 0 || destView.y + destView.height > image->height)) {
sourcePosition = sourceView.Row (y);
destPosition = destView.Row (y);
image->buffer->BlitRow(sourceData, sourcePosition, destPosition, sourceView.width, destView.x, destView.y+y);
for (int y = 0; y < destView.height; y++) {
sourcePosition = sourceView.Row (y);
destPosition = destView.Row (y);
image->buffer->BlitRow(sourceData, sourcePosition, destPosition, sourceView.width);
}
}