gfx/thebes/gfxReusableImageSurfaceWrapper.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/thebes/gfxReusableImageSurfaceWrapper.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#ifndef GFXMEMCOWSURFACEWRAPPER
     1.9 +#define GFXMEMCOWSURFACEWRAPPER
    1.10 +
    1.11 +#include "gfxReusableSurfaceWrapper.h"
    1.12 +
    1.13 +class gfxImageSurface;
    1.14 +
    1.15 +/**
    1.16 + * A cross-thread capable implementation of gfxReusableSurfaceWrapper based
    1.17 + * on gfxImageSurface.
    1.18 + */
    1.19 +class gfxReusableImageSurfaceWrapper : public gfxReusableSurfaceWrapper {
    1.20 +public:
    1.21 +  gfxReusableImageSurfaceWrapper(gfxImageSurface* aSurface);
    1.22 +  ~gfxReusableImageSurfaceWrapper();
    1.23 +
    1.24 +  const unsigned char* GetReadOnlyData() const MOZ_OVERRIDE;
    1.25 +  gfxImageFormat Format() MOZ_OVERRIDE;
    1.26 +  gfxReusableSurfaceWrapper* GetWritable(gfxImageSurface** aSurface) MOZ_OVERRIDE;
    1.27 +  void ReadLock() MOZ_OVERRIDE;
    1.28 +  void ReadUnlock() MOZ_OVERRIDE;
    1.29 +
    1.30 +  Type GetType()
    1.31 +  {
    1.32 +    return TYPE_IMAGE;
    1.33 +  }
    1.34 +
    1.35 +private:
    1.36 +  nsRefPtr<gfxImageSurface>         mSurface;
    1.37 +};
    1.38 +
    1.39 +#endif // GFXMEMCOWSURFACEWRAPPER

mercurial