Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
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/. */
6
7
#include "LayersTypes.h"
8
9
namespace mozilla {
10
namespace layers {
11
12
const char* GetLayersBackendName(LayersBackend aBackend) {
13
switch (aBackend) {
14
case LayersBackend::LAYERS_NONE:
15
return "none";
16
case LayersBackend::LAYERS_OPENGL:
17
return "opengl";
18
case LayersBackend::LAYERS_D3D11:
19
return "d3d11";
20
case LayersBackend::LAYERS_CLIENT:
21
return "client";
22
case LayersBackend::LAYERS_WR:
23
return "webrender";
24
case LayersBackend::LAYERS_BASIC:
25
return "basic";
26
default:
27
MOZ_ASSERT_UNREACHABLE("unknown layers backend");
28
return "unknown";
29
}
30
}
31
32
EventRegions::EventRegions(const nsIntRegion& aHitRegion,
33
const nsIntRegion& aMaybeHitRegion,
34
const nsIntRegion& aDispatchToContentRegion,
35
const nsIntRegion& aNoActionRegion,
36
const nsIntRegion& aHorizontalPanRegion,
37
const nsIntRegion& aVerticalPanRegion,
38
bool aDTCRequiresTargetConfirmation) {
39
mHitRegion = aHitRegion;
40
mNoActionRegion = aNoActionRegion;
41
mHorizontalPanRegion = aHorizontalPanRegion;
42
mVerticalPanRegion = aVerticalPanRegion;
43
// Points whose hit-region status we're not sure about need to be dispatched
44
// to the content thread. If a point is in both maybeHitRegion and hitRegion
45
// then it's not a "maybe" any more, and doesn't go into the dispatch-to-
46
// content region.
47
mDispatchToContentHitRegion.Sub(aMaybeHitRegion, mHitRegion);
48
mDispatchToContentHitRegion.OrWith(aDispatchToContentRegion);
49
mHitRegion.OrWith(aMaybeHitRegion);
50
mDTCRequiresTargetConfirmation = aDTCRequiresTargetConfirmation;
51
}
52
53
} // namespace layers
54
} // namespace mozilla