2012-07-20 12:20:51 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* 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 GFX_SHAREDTEXTUREIMAGE_H
|
|
|
|
#define GFX_SHAREDTEXTUREIMAGE_H
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "GLContextProvider.h" // for GLContextProvider
|
|
|
|
#include "ImageContainer.h" // for Image
|
|
|
|
#include "ImageTypes.h" // for ImageFormat::SHARED_TEXTURE
|
|
|
|
#include "nsCOMPtr.h" // for already_AddRefed
|
2013-12-13 09:32:02 -08:00
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize
|
2013-08-11 16:17:23 -07:00
|
|
|
|
|
|
|
class gfxASurface;
|
2012-07-20 12:20:51 -07:00
|
|
|
|
|
|
|
// Split into a separate header from ImageLayers.h due to GLContext.h dependence
|
|
|
|
// Implementation remains in ImageLayers.cpp
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace layers {
|
|
|
|
|
2013-05-29 14:59:24 -07:00
|
|
|
class SharedTextureImage : public Image {
|
2012-07-20 12:20:51 -07:00
|
|
|
public:
|
|
|
|
struct Data {
|
|
|
|
gl::SharedTextureHandle mHandle;
|
2013-09-04 05:14:52 -07:00
|
|
|
gl::SharedTextureShareType mShareType;
|
2013-12-13 09:32:02 -08:00
|
|
|
gfx::IntSize mSize;
|
2012-07-20 12:20:51 -07:00
|
|
|
bool mInverted;
|
|
|
|
};
|
|
|
|
|
|
|
|
void SetData(const Data& aData) { mData = aData; }
|
|
|
|
const Data* GetData() { return &mData; }
|
|
|
|
|
2013-12-13 09:32:02 -08:00
|
|
|
gfx::IntSize GetSize() { return mData.mSize; }
|
2012-07-20 12:20:51 -07:00
|
|
|
|
2014-01-15 07:06:43 -08:00
|
|
|
virtual already_AddRefed<gfxASurface> DeprecatedGetAsSurface() {
|
2013-10-31 18:54:15 -07:00
|
|
|
return nullptr;
|
2013-04-30 22:03:27 -07:00
|
|
|
}
|
2012-07-20 12:20:51 -07:00
|
|
|
|
2014-01-28 07:27:36 -08:00
|
|
|
virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2014-01-30 14:58:49 -08:00
|
|
|
SharedTextureImage() : Image(nullptr, ImageFormat::SHARED_TEXTURE) {}
|
2012-07-20 12:20:51 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
Data mData;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // layers
|
|
|
|
} // mozilla
|
|
|
|
|
2012-11-26 14:23:27 -08:00
|
|
|
#endif // GFX_SHAREDTEXTUREIMAGE_H
|