michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GFXMEMCOWSURFACEWRAPPER michael@0: #define GFXMEMCOWSURFACEWRAPPER michael@0: michael@0: #include "gfxReusableSurfaceWrapper.h" michael@0: michael@0: class gfxImageSurface; michael@0: michael@0: /** michael@0: * A cross-thread capable implementation of gfxReusableSurfaceWrapper based michael@0: * on gfxImageSurface. michael@0: */ michael@0: class gfxReusableImageSurfaceWrapper : public gfxReusableSurfaceWrapper { michael@0: public: michael@0: gfxReusableImageSurfaceWrapper(gfxImageSurface* aSurface); michael@0: ~gfxReusableImageSurfaceWrapper(); michael@0: michael@0: const unsigned char* GetReadOnlyData() const MOZ_OVERRIDE; michael@0: gfxImageFormat Format() MOZ_OVERRIDE; michael@0: gfxReusableSurfaceWrapper* GetWritable(gfxImageSurface** aSurface) MOZ_OVERRIDE; michael@0: void ReadLock() MOZ_OVERRIDE; michael@0: void ReadUnlock() MOZ_OVERRIDE; michael@0: michael@0: Type GetType() michael@0: { michael@0: return TYPE_IMAGE; michael@0: } michael@0: michael@0: private: michael@0: nsRefPtr mSurface; michael@0: }; michael@0: michael@0: #endif // GFXMEMCOWSURFACEWRAPPER