From cbed44e627a29b2c5b8f45d7ca71bda3b01eb069 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 16 Apr 2015 20:25:40 -0300 Subject: [PATCH] Add LockedSurface::lockedWidth/Height() member functions --- src/she/alleg4/surface.h | 8 ++++++++ src/she/locked_surface.h | 2 ++ src/she/skia/skia_surface.h | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/src/she/alleg4/surface.h b/src/she/alleg4/surface.h index 63624ab46..a3898cf32 100644 --- a/src/she/alleg4/surface.h +++ b/src/she/alleg4/surface.h @@ -191,6 +191,14 @@ namespace she { // LockedSurface implementation + int lockedWidth() const override { + return m_bmp->w; + } + + int lockedHeight() const override { + return m_bmp->h; + } + void unlock() override { release_bitmap(m_bmp); } diff --git a/src/she/locked_surface.h b/src/she/locked_surface.h index b764d3f19..bb22f013c 100644 --- a/src/she/locked_surface.h +++ b/src/she/locked_surface.h @@ -25,6 +25,8 @@ namespace she { class LockedSurface { public: virtual ~LockedSurface() { } + virtual int lockedWidth() const = 0; + virtual int lockedHeight() const = 0; virtual void unlock() = 0; virtual void clear() = 0; diff --git a/src/she/skia/skia_surface.h b/src/she/skia/skia_surface.h index 96135b057..6ab6956f7 100644 --- a/src/she/skia/skia_surface.h +++ b/src/she/skia/skia_surface.h @@ -85,6 +85,14 @@ public: // LockedSurface impl + int lockedWidth() const override { + return m_bitmap.width(); + } + + int lockedHeight() const override { + return m_bitmap.height(); + } + void unlock() override { m_bitmap.unlockPixels(); }