Make typing responsive when an image is on the screen.

Patch not needed for 1.3.x.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9884 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2005-04-28 09:39:51 +00:00
parent 5c806f1088
commit cf7f310eb9
4 changed files with 19 additions and 9 deletions

View File

@ -1,3 +1,14 @@
2005-04-28 Angus Leeming <leeming@lyx.org>
* QLImage.[Ch] (transformed_pixmap_): new variable. The image
pixmap is prepared for display in setPixmap_impl, so buffer it
for future redraws.
(copy ctor): copy the data, don't regenerate it from original_;
(dtor): use machine-generated destructor.
* QLPainter.C (image): use bitBlt to draw the buffered image
pixmap efficiently.
2005-04-25 Angus Leeming <leeming@lyx.org>
* pch.h:

View File

@ -112,15 +112,11 @@ QLImage::QLImage()
QLImage::QLImage(QLImage const & other)
: Image(other), original_(other.original_),
transformed_(other.original_)
transformed_(other.transformed_),
transformed_pixmap_(other.transformed_pixmap_)
{}
QLImage::~QLImage()
{
}
Image * QLImage::clone_impl() const
{
return new QLImage(*this);
@ -204,6 +200,7 @@ bool QLImage::setPixmap_impl(Params const & params)
break;
}
transformed_pixmap_ = transformed_;
return true;
}

View File

@ -29,8 +29,8 @@ public:
/// Return the list of loadable formats.
static FormatList loadableFormats();
~QLImage();
QImage const & qimage() const { return transformed_; }
/// Retrieve the buffered pixmap.
QPixmap const & qpixmap() const { return transformed_pixmap_; }
private:
/// Create a copy
@ -70,6 +70,8 @@ private:
/// The transformed image for display.
QImage transformed_;
/// Buffer the pixmap itself
QPixmap transformed_pixmap_;
};
} // namespace graphics

View File

@ -171,7 +171,7 @@ void QLPainter::image(int x, int y, int w, int h,
static_cast<lyx::graphics::QLImage const &>(i);
fillRectangle(x, y, w, h, LColor::graphicsbg);
qp_->drawImage(x, y, qlimage.qimage(), 0, 0, w, h);
bitBlt(qp_->device(), x, y, &qlimage.qpixmap(), 0, 0, w, h);
}