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>
|
2016-03-14 18:39:12 +03:00
|
|
|
#include "gfxMatrix.h"
|
2013-11-29 08:11:49 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace gl { class GLContext; }
|
|
|
|
|
|
|
|
namespace layers {
|
|
|
|
|
2016-03-14 18:39:12 +03:00
|
|
|
|
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;
|
2016-03-14 18:39:12 +03:00
|
|
|
class TextureHost;
|
2013-11-29 08:11:49 +04:00
|
|
|
|
|
|
|
class LayerScope {
|
|
|
|
public:
|
2015-05-22 12:36:00 +03:00
|
|
|
static void DrawBegin();
|
|
|
|
static void SetRenderOffset(float aX, float aY);
|
|
|
|
static void SetLayerTransform(const gfx::Matrix4x4& aMatrix);
|
2015-08-03 09:11:00 +03:00
|
|
|
static void SetDrawRects(size_t aRects,
|
|
|
|
const gfx::Rect* aLayerRects,
|
|
|
|
const gfx::Rect* aTextureRects);
|
2015-05-22 12:36:00 +03:00
|
|
|
static void DrawEnd(gl::GLContext* aGLContext,
|
|
|
|
const EffectChain& aEffectChain,
|
|
|
|
int aWidth,
|
|
|
|
int aHeight);
|
|
|
|
|
2014-07-03 03:17:00 +04:00
|
|
|
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
|
|
|
|
2015-08-03 09:11:00 +03:00
|
|
|
static void SetPixelScale(double devPixelsPerCSSPixel);
|
2015-06-02 13:21:00 +03:00
|
|
|
static void ContentChanged(TextureHost *host);
|
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
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
2013-11-29 08:11:49 +04:00
|
|
|
|
|
|
|
#endif /* GFX_LAYERSCOPE_H */
|