2015-01-16 10:00:25 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim:set ts=4 sw=4 sts=4 et: */
|
2013-11-29 08:11:49 +04:00
|
|
|
/* 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_LAYERSCOPE_H
|
|
|
|
#define GFX_LAYERSCOPE_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2014-07-28 00:32:00 +04:00
|
|
|
#include <mozilla/UniquePtr.h>
|
2013-11-29 08:11:49 +04:00
|
|
|
|
|
|
|
struct nsIntSize;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace gl { class GLContext; }
|
|
|
|
|
|
|
|
namespace layers {
|
|
|
|
|
2014-07-28 00:32:00 +04:00
|
|
|
namespace layerscope { class Packet; }
|
|
|
|
|
2013-11-29 08:11:49 +04:00
|
|
|
struct EffectChain;
|
2014-07-03 03:17:00 +04:00
|
|
|
class LayerComposite;
|
2013-11-29 08:11:49 +04:00
|
|
|
|
|
|
|
class LayerScope {
|
|
|
|
public:
|
|
|
|
static void SendEffectChain(gl::GLContext* aGLContext,
|
|
|
|
const EffectChain& aEffectChain,
|
2014-07-03 03:17:00 +04:00
|
|
|
int aWidth,
|
|
|
|
int aHeight);
|
|
|
|
static void SendLayer(LayerComposite* aLayer,
|
|
|
|
int aWidth,
|
|
|
|
int aHeight);
|
2014-07-28 00:32:00 +04:00
|
|
|
static void SendLayerDump(UniquePtr<layerscope::Packet> aPacket);
|
2014-07-03 03:17:00 +04:00
|
|
|
static bool CheckSendable();
|
|
|
|
static void CleanLayer();
|
2015-01-16 10:00:25 +03:00
|
|
|
static void SetHWComposed();
|
2014-11-20 04:00:00 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
static void Init();
|
2014-07-03 03:17:00 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// Perform BeginFrame and EndFrame automatically
|
|
|
|
class LayerScopeAutoFrame {
|
|
|
|
public:
|
2014-08-20 08:55:14 +04:00
|
|
|
explicit LayerScopeAutoFrame(int64_t aFrameStamp);
|
2014-07-03 03:17:00 +04:00
|
|
|
~LayerScopeAutoFrame();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static void BeginFrame(int64_t aFrameStamp);
|
|
|
|
static void EndFrame();
|
2013-11-29 08:11:49 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} /* layers */
|
|
|
|
} /* mozilla */
|
|
|
|
|
|
|
|
#endif /* GFX_LAYERSCOPE_H */
|