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