From 55cafac73591ee360f474b0ac24c4cffce165f42 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 16 Apr 2015 20:26:05 -0300 Subject: [PATCH] Proper clipping in CommonLockedSurface::drawColoredRgbaSurface() impl --- src/she/common/locked_surface.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/she/common/locked_surface.h b/src/she/common/locked_surface.h index 7ddb76344..063faf482 100644 --- a/src/she/common/locked_surface.h +++ b/src/she/common/locked_surface.h @@ -59,7 +59,11 @@ gfx::Color blend(const gfx::Color back, gfx::Color front) class CommonLockedSurface : public LockedSurface { public: - void drawColoredRgbaSurface(const LockedSurface* src, gfx::Color fg, gfx::Color bg, const gfx::Clip& clip) override { + void drawColoredRgbaSurface(const LockedSurface* src, gfx::Color fg, gfx::Color bg, const gfx::Clip& clipbase) override { + gfx::Clip clip(clipbase); + if (!clip.clip(lockedWidth(), lockedHeight(), src->lockedWidth(), src->lockedHeight())) + return; + SurfaceFormatData format; src->getFormat(&format);