gfx/thebes/gfxReusableImageSurfaceWrapper.h
author ffxbld
Thu, 13 Feb 2014 19:59:34 -0500
branchGECKO280b3_2014021319_RELBRANCH
changeset 176295 1f89dd5f5d38ea7361e472ec5ae547f8c338f04c
parent 163259 1892aa2a6de84d83a3c0aff80b0153d925e48ebc
child 216144 91a4d189f5d75a231be157f9be994b3b4b13f062
permissions -rw-r--r--
Automated checkin: version bump for firefox 28.0b3 release. DONTBUILD CLOSED TREE a=release

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFXMEMCOWSURFACEWRAPPER
#define GFXMEMCOWSURFACEWRAPPER

#include "gfxReusableSurfaceWrapper.h"

class gfxImageSurface;

/**
 * A cross-thread capable implementation of gfxReusableSurfaceWrapper based
 * on gfxImageSurface.
 */
class gfxReusableImageSurfaceWrapper : public gfxReusableSurfaceWrapper {
public:
  gfxReusableImageSurfaceWrapper(gfxImageSurface* aSurface);
  ~gfxReusableImageSurfaceWrapper();

  const unsigned char* GetReadOnlyData() const MOZ_OVERRIDE;
  gfxImageFormat Format() MOZ_OVERRIDE;
  gfxReusableSurfaceWrapper* GetWritable(gfxImageSurface** aSurface) MOZ_OVERRIDE;
  void ReadLock() MOZ_OVERRIDE;
  void ReadUnlock() MOZ_OVERRIDE;

  Type GetType()
  {
    return TYPE_IMAGE;
  }

private:
  nsRefPtr<gfxImageSurface>         mSurface;
};

#endif // GFXMEMCOWSURFACEWRAPPER