[gfx][Skia] Hold mutex while accessing shared SkImage data.

This commit is contained in:
Moonchild 2020-11-18 22:06:11 +00:00 • committed by roytam1
commit 3cac4d852d
3 changed files with 54 additions and 17 deletions

View file

@ -10,6 +10,10 @@
#include <vector>
#include "skia/include/core/SkCanvas.h"
#include "skia/include/core/SkImage.h"
#include "mozilla/Maybe.h"
#include "mozilla/Mutex.h"
typedef mozilla::MutexAutoLock MutexAutoLock;
namespace mozilla {
@ -28,7 +32,7 @@ public:
virtual IntSize GetSize() const;
virtual SurfaceFormat GetFormat() const;
sk_sp<SkImage>& GetImage() { return mImage; }
sk_sp<SkImage> GetImage(Maybe<MutexAutoLock>* aLock);
bool InitFromData(unsigned char* aData,
const IntSize &aSize,