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_SHAREDTEXTUREIMAGE_H michael@0: #define GFX_SHAREDTEXTUREIMAGE_H michael@0: michael@0: #include "GLContextProvider.h" // for GLContextProvider michael@0: #include "ImageContainer.h" // for Image michael@0: #include "ImageTypes.h" // for ImageFormat::SHARED_TEXTURE michael@0: #include "nsCOMPtr.h" // for already_AddRefed michael@0: #include "mozilla/gfx/Point.h" // for IntSize michael@0: michael@0: // Split into a separate header from ImageLayers.h due to GLContext.h dependence michael@0: // Implementation remains in ImageLayers.cpp michael@0: michael@0: namespace mozilla { michael@0: michael@0: namespace layers { michael@0: michael@0: class SharedTextureImage : public Image { michael@0: public: michael@0: struct Data { michael@0: gl::SharedTextureHandle mHandle; michael@0: gl::SharedTextureShareType mShareType; michael@0: gfx::IntSize mSize; michael@0: bool mInverted; michael@0: }; michael@0: michael@0: void SetData(const Data& aData) { mData = aData; } michael@0: const Data* GetData() { return &mData; } michael@0: michael@0: gfx::IntSize GetSize() { return mData.mSize; } michael@0: michael@0: virtual TemporaryRef GetAsSourceSurface() MOZ_OVERRIDE michael@0: { michael@0: return nullptr; michael@0: } michael@0: michael@0: SharedTextureImage() : Image(nullptr, ImageFormat::SHARED_TEXTURE) {} michael@0: michael@0: private: michael@0: Data mData; michael@0: }; michael@0: michael@0: } // layers michael@0: } // mozilla michael@0: michael@0: #endif // GFX_SHAREDTEXTUREIMAGE_H