2017-10-28 02:10:06 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2013-11-18 06:04:38 +04:00
|
|
|
* 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:
|
2016-06-27 18:25:13 +03:00
|
|
|
static MacIOSurfaceTextureData* Create(MacIOSurface* aSurface,
|
|
|
|
gfx::BackendType aBackend);
|
|
|
|
|
|
|
|
static MacIOSurfaceTextureData*
|
|
|
|
Create(const gfx::IntSize& aSize, gfx::SurfaceFormat aFormat,
|
|
|
|
gfx::BackendType aBackend);
|
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
|
|
|
|
2016-04-22 19:05:26 +03:00
|
|
|
virtual void FillInfo(TextureData::Info& aInfo) const override;
|
2014-03-08 01:34:04 +04:00
|
|
|
|
2016-10-27 11:02:09 +03:00
|
|
|
virtual bool Lock(OpenMode) override;
|
2016-06-27 18:25:13 +03:00
|
|
|
|
|
|
|
virtual void Unlock() override;
|
2015-11-20 18:55:26 +03:00
|
|
|
|
2016-06-27 18:25:13 +03:00
|
|
|
virtual already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() 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-09-27 06:22:20 +03:00
|
|
|
virtual void Deallocate(LayersIPCChannel*) override;
|
2016-06-27 18:25:13 +03:00
|
|
|
|
2016-09-27 06:22:20 +03:00
|
|
|
virtual void Forget(LayersIPCChannel*) override;
|
2015-11-20 16:24:46 +03:00
|
|
|
|
2016-06-27 18:25:13 +03:00
|
|
|
virtual bool UpdateFromSurface(gfx::SourceSurface* aSurface) override;
|
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:
|
2016-06-27 18:25:13 +03:00
|
|
|
MacIOSurfaceTextureData(MacIOSurface* aSurface,
|
|
|
|
gfx::BackendType aBackend);
|
2015-11-20 16:24:46 +03:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<MacIOSurface> mSurface;
|
2016-06-27 18:25:13 +03:00
|
|
|
gfx::BackendType mBackend;
|
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
|