Bug 1691109 [wpt PR 27513] - Increase timeout duration for wpt/fetch/api/basic/keepal...
[gecko.git] / gfx / layers / LayerScope.h
blob89c09d46a2acd95110a33a13014713c676536d46
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
10 #include <stdint.h>
11 #include <mozilla/UniquePtr.h>
12 #include "gfxMatrix.h"
13 #include "mozilla/gfx/Rect.h"
15 namespace mozilla {
17 namespace gl {
18 class GLContext;
21 namespace layers {
23 namespace layerscope {
24 class Packet;
27 struct EffectChain;
28 class LayerComposite;
29 class TextureHost;
31 class LayerScope {
32 public:
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);
50 private:
51 static void Init();
54 // Perform BeginFrame and EndFrame automatically
55 class LayerScopeAutoFrame final {
56 public:
57 explicit LayerScopeAutoFrame(int64_t aFrameStamp);
58 ~LayerScopeAutoFrame();
60 private:
61 static void BeginFrame(int64_t aFrameStamp);
62 static void EndFrame();
65 } // namespace layers
66 } // namespace mozilla
68 #endif /* GFX_LAYERSCOPE_H */