2013-11-18 06:04:38 +04: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 MOZILLA_GFX_MACIOSURFACETEXTURECLIENTOGL_H
|
|
|
|
#define MOZILLA_GFX_MACIOSURFACETEXTURECLIENTOGL_H
|
|
|
|
|
|
|
|
#include "mozilla/layers/TextureClientOGL.h"
|
|
|
|
|
|
|
|
class MacIOSurface;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2015-11-20 16:24:46 +03:00
|
|
|
class MacIOSurfaceTextureData : public TextureData
|
2013-11-18 06:04:38 +04:00
|
|
|
{
|
|
|
|
public:
|
2015-11-20 16:24:46 +03:00
|
|
|
static MacIOSurfaceTextureData* Create(MacIOSurface* aSurface);
|
2013-11-18 06:04:38 +04:00
|
|
|
|
2015-11-20 16:24:46 +03:00
|
|
|
~MacIOSurfaceTextureData();
|
2013-11-18 06:04:38 +04:00
|
|
|
|
2015-11-20 16:24:46 +03:00
|
|
|
virtual gfx::IntSize GetSize() const override;
|
2013-11-18 06:04:38 +04:00
|
|
|
|
2015-11-20 16:24:46 +03:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() const override;
|
2014-03-08 01:34:04 +04:00
|
|
|
|
2015-11-20 16:24:46 +03:00
|
|
|
virtual bool Lock(OpenMode, FenceHandle*) override { return true; }
|
2015-11-20 18:55:26 +03:00
|
|
|
|
2015-11-20 16:24:46 +03:00
|
|
|
virtual void Unlock() override {}
|
2015-11-20 16:24:46 +03:00
|
|
|
|
2015-11-20 16:24:46 +03:00
|
|
|
virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
2015-11-24 21:07:02 +03:00
|
|
|
|
2016-02-25 16:15:58 +03:00
|
|
|
virtual bool HasIntermediateBuffer() const override { return false; }
|
2015-11-20 16:24:46 +03:00
|
|
|
|
2016-03-21 17:18:20 +03:00
|
|
|
virtual void Deallocate(ClientIPCAllocator*) override { mSurface = nullptr; }
|
2015-11-20 16:24:46 +03:00
|
|
|
|
2016-03-21 17:18:20 +03:00
|
|
|
virtual void Forget(ClientIPCAllocator*) override { mSurface = nullptr; }
|
2014-12-18 21:32:45 +03:00
|
|
|
|
2015-11-20 16:24:46 +03:00
|
|
|
// For debugging purposes only.
|
|
|
|
already_AddRefed<gfx::DataSourceSurface> GetAsSurface();
|
2014-07-25 13:24:46 +04:00
|
|
|
|
2013-11-18 06:04:38 +04:00
|
|
|
protected:
|
2015-11-20 16:24:46 +03:00
|
|
|
explicit MacIOSurfaceTextureData(MacIOSurface* aSurface);
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<MacIOSurface> mSurface;
|
2013-11-18 06:04:38 +04:00
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
2013-11-18 06:04:38 +04:00
|
|
|
|
2014-05-14 17:29:52 +04:00
|
|
|
#endif // MOZILLA_GFX_MACIOSURFACETEXTURECLIENTOGL_H
|