michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- 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 michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GFX_MACIOSURFACEIMAGE_H michael@0: #define GFX_MACIOSURFACEIMAGE_H michael@0: michael@0: #include "ImageContainer.h" michael@0: #include "mozilla/gfx/MacIOSurface.h" michael@0: #include "mozilla/gfx/Point.h" michael@0: #include "mozilla/layers/TextureClient.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: namespace layers { michael@0: michael@0: class MacIOSurfaceImage : public Image, michael@0: public ISharedImage { michael@0: public: michael@0: void SetSurface(MacIOSurface* aSurface) { mSurface = aSurface; } michael@0: MacIOSurface* GetSurface() { return mSurface; } michael@0: michael@0: gfx::IntSize GetSize() { michael@0: return gfx::IntSize(mSurface->GetDevicePixelWidth(), mSurface->GetDevicePixelHeight()); michael@0: } michael@0: michael@0: virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; } michael@0: michael@0: virtual TemporaryRef GetAsSourceSurface(); michael@0: michael@0: virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE; michael@0: virtual uint8_t* GetBuffer() MOZ_OVERRIDE { return nullptr; } michael@0: michael@0: MacIOSurfaceImage() : Image(nullptr, ImageFormat::MAC_IOSURFACE) {} michael@0: michael@0: private: michael@0: RefPtr mSurface; michael@0: RefPtr mTextureClient; michael@0: }; michael@0: michael@0: } // layers michael@0: } // mozilla michael@0: michael@0: #endif // GFX_SHAREDTEXTUREIMAGE_H