Kaydet (Commit) ae46ea51 authored tarafından Miklos Vajna's avatar Miklos Vajna Kaydeden (comit) Andras Timar

tdf#92982 vcl rendercontext: set correct offset for the frame-level buffer

In case we had a toplevel window W1, the paint was triggered for window
W2 and we had a sub-widget W3, then previously the buffer was created
for W2, so the pixel offsets had to be set relative to W2 when rendering
W3. As a consequence, if a single window was painted, then it was
always painted in the top left corner.

Now that the buffer is persistent and is always created for W1, make
sure that we paint to the correct offset, and W3 is always painted at
the same offset, regardless if it was painted directly, or just because
it's a child of W2.

With this, the buffer conents is closer to what is on the screen, even
if it's not perfect yet.

Also:

- PaintHelper: restore set buffer properties
- let PaintBufferGuard also manage pixel offset
- no need to tweak map mode in PaintBuffer()

Conflicts:
	vcl/source/window/paint.cxx

(cherry picked from commits 94a6daa0,
c36a00b8,
28e465d2 and
ec1a0354)

Change-Id: Ibf0e89ad18e5763bd2a01e69d91da163c24a309d
Reviewed-on: https://gerrit.libreoffice.org/17518Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 17c35916
......@@ -318,7 +318,6 @@ namespace vcl {
class VCL_DLLPUBLIC OutputDevice
{
friend class PaintHelper;
friend class Printer;
friend class VirtualDevice;
friend class vcl::Window;
......@@ -499,6 +498,8 @@ public:
long GetOutputHeightPixel() const { return mnOutHeight; }
long GetOutOffXPixel() const { return mnOutOffX; }
long GetOutOffYPixel() const { return mnOutOffY; }
void SetOutOffXPixel(long nOutOffX);
void SetOutOffYPixel(long nOutOffY);
Size GetOutputSize() const
{ return PixelToLogic( GetOutputSizePixel() ); }
......
......@@ -427,6 +427,16 @@ sal_uInt16 OutputDevice::GetBitCount() const
return (sal_uInt16)mpGraphics->GetBitCount();
}
void OutputDevice::SetOutOffXPixel(long nOutOffX)
{
mnOutOffX = nOutOffX;
}
void OutputDevice::SetOutOffYPixel(long nOutOffY)
{
mnOutOffY = nOutOffY;
}
sal_uLong OutputDevice::GetColorCount() const
{
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment