PicView uses a faster rect fill

Change-Id: I08fdff5b85fa7687a37556ca1d88a51cf338ab12
This commit is contained in:
Romain Goyet
2016-08-08 12:01:09 +02:00
parent 3cd4639f44
commit afebacdb63

View File

@@ -9,12 +9,6 @@ PicView::PicView() :
void PicView::drawRect(KDContext * ctx, KDRect rect) const {
KDColor * pixels = (KDColor *)apps_picview_image_raw;
KDCoordinate width = bounds().width();
KDCoordinate height = bounds().height();
assert(apps_picview_image_raw_len == width*height*sizeof(KDColor));
for (int j=0; j<height; j++) {
for (int i=0; i<width; i++) {
ctx->setPixel(KDPoint(i,j), pixels[j*width+i]);
}
}
assert(apps_picview_image_raw_len == bounds().width() * bounds().height() * sizeof(KDColor));
ctx->fillRectWithPixels(bounds(), pixels, nullptr);
}