2015-01-16 07:00:25 +00: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 04:11:49 +00: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-27 20:32:00 +00:00
|
|
|
#include <mozilla/UniquePtr.h>
|
2016-03-14 15:39:12 +00:00
|
|
|
#include "gfxMatrix.h"
|
2013-11-29 04:11:49 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace gl { class GLContext; }
|
|
|
|
|
|
|
|
namespace layers {
|
|
|
|
|
2016-03-14 15:39:12 +00:00
|
|
|
|
2014-07-27 20:32:00 +00:00
|
|
|
namespace layerscope { class Packet; }
|
|
|
|
|
2013-11-29 04:11:49 +00:00
|
|
|
struct EffectChain;
|
2014-07-02 23:17:00 +00:00
|
|
|
class LayerComposite;
|
2016-03-14 15:39:12 +00:00
|
|
|
class TextureHost;
|
2013-11-29 04:11:49 +00:00
|
|
|
|
|
|
|
class LayerScope {
|
|
|
|
public:
|
2015-05-22 09:36:00 +00:00
|
|
|
static void DrawBegin();
|
|
|
|
static void SetRenderOffset(float aX, float aY);
|
|
|
|
static void SetLayerTransform(const gfx::Matrix4x4& aMatrix);
|
2015-08-03 06:11:00 +00:00
|
|
|
static void SetDrawRects(size_t aRects,
|
|
|
|
const gfx::Rect* aLayerRects,
|
|
|
|
const gfx::Rect* aTextureRects);
|
2015-05-22 09:36:00 +00:00
|
|
|
static void DrawEnd(gl::GLContext* aGLContext,
|
|
|
|
const EffectChain& aEffectChain,
|
|
|
|
int aWidth,
|
|
|
|
int aHeight);
|
|
|
|
|
2014-07-02 23:17:00 +00:00
|
|
|
static void SendLayer(LayerComposite* aLayer,
|
|
|
|
int aWidth,
|
|
|
|
int aHeight);
|
2014-07-27 20:32:00 +00:00
|
|
|
static void SendLayerDump(UniquePtr<layerscope::Packet> aPacket);
|
2014-07-02 23:17:00 +00:00
|
|
|
static bool CheckSendable();
|
|
|
|
static void CleanLayer();
|
2015-01-16 07:00:25 +00:00
|
|
|
static void SetHWComposed();
|
2014-11-20 01:00:00 +00:00
|
|
|
|
2015-08-03 06:11:00 +00:00
|
|
|
static void SetPixelScale(double devPixelsPerCSSPixel);
|
2015-06-02 10:21:00 +00:00
|
|
|
static void ContentChanged(TextureHost *host);
|
2014-11-20 01:00:00 +00:00
|
|
|
private:
|
|
|
|
static void Init();
|
2014-07-02 23:17:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Perform BeginFrame and EndFrame automatically
|
|
|
|
class LayerScopeAutoFrame {
|
|
|
|
public:
|
2014-08-20 04:55:14 +00:00
|
|
|
explicit LayerScopeAutoFrame(int64_t aFrameStamp);
|
2014-07-02 23:17:00 +00:00
|
|
|
~LayerScopeAutoFrame();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static void BeginFrame(int64_t aFrameStamp);
|
|
|
|
static void EndFrame();
|
2013-11-29 04:11:49 +00:00
|
|
|
};
|
|
|
|
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
2013-11-29 04:11:49 +00:00
|
|
|
|
|
|
|
#endif /* GFX_LAYERSCOPE_H */
|