1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=4 sw=2 sts=2 et: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef GFX_LAYERSCOPE_H
8 #define GFX_LAYERSCOPE_H
11 #include <mozilla/UniquePtr.h>
12 #include "gfxMatrix.h"
13 #include "mozilla/gfx/Rect.h"
23 namespace layerscope
{
33 static void DrawBegin();
34 static void SetRenderOffset(float aX
, float aY
);
35 static void SetLayerTransform(const gfx::Matrix4x4
& aMatrix
);
36 static void SetDrawRects(size_t aRects
, const gfx::Rect
* aLayerRects
,
37 const gfx::Rect
* aTextureRects
);
38 static void DrawEnd(gl::GLContext
* aGLContext
,
39 const EffectChain
& aEffectChain
, int aWidth
, int aHeight
);
41 static void SendLayer(LayerComposite
* aLayer
, int aWidth
, int aHeight
);
42 static void SendLayerDump(UniquePtr
<layerscope::Packet
> aPacket
);
43 static bool CheckSendable();
44 static void CleanLayer();
45 static void SetHWComposed();
47 static void SetPixelScale(double devPixelsPerCSSPixel
);
48 static void ContentChanged(TextureHost
* host
);
54 // Perform BeginFrame and EndFrame automatically
55 class LayerScopeAutoFrame final
{
57 explicit LayerScopeAutoFrame(int64_t aFrameStamp
);
58 ~LayerScopeAutoFrame();
61 static void BeginFrame(int64_t aFrameStamp
);
62 static void EndFrame();
66 } // namespace mozilla
68 #endif /* GFX_LAYERSCOPE_H */