From 6b25004b488836e50df766f66e0f165a7ec4ed55 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 16 Apr 2015 15:38:44 -0300 Subject: [PATCH] Add SkiaSurface::swapBitmap() --- src/she/skia/skia_surface.h | 6 +++++- src/she/skia/skia_system.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/she/skia/skia_surface.h b/src/she/skia/skia_surface.h index bf4954a83..96135b057 100644 --- a/src/she/skia/skia_surface.h +++ b/src/she/skia/skia_surface.h @@ -76,7 +76,7 @@ public: SkRect dstRect = SkRect::Make(SkIRect::MakeXYWH(0, 0, result.width(), result.height())); canvas.drawBitmapRectToRect(m_bitmap, &srcRect, dstRect); - m_bitmap.swap(result); + swapBitmap(result); } void* nativeHandle() override { @@ -204,6 +204,10 @@ public: return m_bitmap; } + void swapBitmap(SkBitmap& other) { + m_bitmap.swap(other); + } + private: SkBitmap m_bitmap; }; diff --git a/src/she/skia/skia_system.h b/src/she/skia/skia_system.h index d436b1575..355705e22 100644 --- a/src/she/skia/skia_system.h +++ b/src/she/skia/skia_system.h @@ -72,7 +72,7 @@ public: bm.pixelRef()->setURI(filename); SkiaSurface* sur = new SkiaSurface(); - sur->bitmap().swap(bm); + sur->swapBitmap(bm); return sur; } }