2012-07-18 20:31:40 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* 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/. */
|
|
|
|
|
2012-07-31 04:42:26 +04:00
|
|
|
#ifndef GFX_LAYERSTYPES_H
|
|
|
|
#define GFX_LAYERSTYPES_H
|
2012-07-18 20:31:40 +04:00
|
|
|
|
2013-08-12 03:17:23 +04:00
|
|
|
#include <stdint.h> // for uint32_t
|
2014-01-23 22:26:41 +04:00
|
|
|
|
2016-01-07 02:56:25 +03:00
|
|
|
#include "Units.h"
|
2017-07-01 04:18:55 +03:00
|
|
|
#include "mozilla/DefineEnum.h" // for MOZ_DEFINE_ENUM
|
2015-09-28 16:55:48 +03:00
|
|
|
#include "mozilla/gfx/Point.h" // for IntPoint
|
2017-06-02 10:11:34 +03:00
|
|
|
#include "mozilla/Maybe.h"
|
2015-09-28 16:55:48 +03:00
|
|
|
#include "mozilla/TypedEnumBits.h"
|
|
|
|
#include "nsRegion.h"
|
|
|
|
|
2015-05-09 00:37:01 +03:00
|
|
|
#include <stdio.h> // FILE
|
2015-05-19 21:15:34 +03:00
|
|
|
#include "mozilla/Logging.h" // for PR_LOG
|
2015-09-28 16:55:48 +03:00
|
|
|
|
2015-05-09 00:37:01 +03:00
|
|
|
#ifndef MOZ_LAYERS_HAVE_LOG
|
|
|
|
# define MOZ_LAYERS_HAVE_LOG
|
|
|
|
#endif
|
|
|
|
#define MOZ_LAYERS_LOG(_args) \
|
2015-06-04 01:25:57 +03:00
|
|
|
MOZ_LOG(LayerManager::GetLog(), LogLevel::Debug, _args)
|
2015-05-09 00:37:01 +03:00
|
|
|
#define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args) \
|
2015-06-04 01:25:57 +03:00
|
|
|
do { if (layer->AsShadowableLayer()) { MOZ_LOG(LayerManager::GetLog(), LogLevel::Debug, _args); } } while (0)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
|
2014-08-19 06:14:00 +04:00
|
|
|
#define INVALID_OVERLAY -1
|
|
|
|
|
2017-08-11 04:57:21 +03:00
|
|
|
//#define ENABLE_FRAME_LATENCY_LOG
|
|
|
|
|
2016-12-21 18:43:47 +03:00
|
|
|
namespace IPC {
|
|
|
|
template <typename T> struct ParamTraits;
|
|
|
|
} // namespace IPC
|
|
|
|
|
2013-06-06 02:14:51 +04:00
|
|
|
namespace android {
|
2015-06-08 12:27:23 +03:00
|
|
|
class MOZ_EXPORT GraphicBuffer;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace android
|
2013-06-06 02:14:51 +04:00
|
|
|
|
2012-07-18 20:31:40 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
|
2014-02-25 08:23:41 +04:00
|
|
|
class TextureHost;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
|
2014-01-23 22:26:41 +04:00
|
|
|
#undef NONE
|
|
|
|
#undef OPAQUE
|
|
|
|
|
2015-01-26 01:22:07 +03:00
|
|
|
enum class LayersBackend : int8_t {
|
2012-07-18 20:31:40 +04:00
|
|
|
LAYERS_NONE = 0,
|
|
|
|
LAYERS_BASIC,
|
|
|
|
LAYERS_OPENGL,
|
2013-05-03 21:34:29 +04:00
|
|
|
LAYERS_D3D11,
|
2013-05-01 09:03:25 +04:00
|
|
|
LAYERS_CLIENT,
|
2016-11-16 16:54:51 +03:00
|
|
|
LAYERS_WR,
|
2012-07-18 20:31:40 +04:00
|
|
|
LAYERS_LAST
|
2015-01-26 01:22:07 +03:00
|
|
|
};
|
2012-07-31 04:42:26 +04:00
|
|
|
|
2015-01-26 01:22:07 +03:00
|
|
|
enum class BufferMode : int8_t {
|
2012-07-31 04:42:26 +04:00
|
|
|
BUFFER_NONE,
|
2014-01-23 22:26:41 +04:00
|
|
|
BUFFERED
|
2015-01-26 01:22:07 +03:00
|
|
|
};
|
2012-07-31 04:42:26 +04:00
|
|
|
|
2015-01-26 01:22:07 +03:00
|
|
|
enum class DrawRegionClip : int8_t {
|
2014-01-23 22:26:41 +04:00
|
|
|
DRAW,
|
2014-10-01 09:25:25 +04:00
|
|
|
NONE
|
2015-01-26 01:22:07 +03:00
|
|
|
};
|
2013-11-06 23:10:50 +04:00
|
|
|
|
2015-01-26 01:22:07 +03:00
|
|
|
enum class SurfaceMode : int8_t {
|
2014-01-17 18:00:00 +04:00
|
|
|
SURFACE_NONE = 0,
|
|
|
|
SURFACE_OPAQUE,
|
|
|
|
SURFACE_SINGLE_CHANNEL_ALPHA,
|
|
|
|
SURFACE_COMPONENT_ALPHA
|
2015-01-26 01:22:07 +03:00
|
|
|
};
|
2014-01-17 18:00:00 +04:00
|
|
|
|
2017-07-01 04:18:55 +03:00
|
|
|
MOZ_DEFINE_ENUM_CLASS_WITH_BASE(
|
|
|
|
ScaleMode, int8_t, (
|
|
|
|
SCALE_NONE,
|
|
|
|
STRETCH
|
2014-01-23 22:26:41 +04:00
|
|
|
// Unimplemented - PRESERVE_ASPECT_RATIO_CONTAIN
|
2017-07-01 04:18:55 +03:00
|
|
|
));
|
2013-08-20 23:45:30 +04:00
|
|
|
|
2013-12-16 14:47:06 +04:00
|
|
|
struct EventRegions {
|
2015-03-24 16:13:24 +03:00
|
|
|
// The hit region for a layer contains all areas on the layer that are
|
|
|
|
// sensitive to events. This region is an over-approximation and may
|
|
|
|
// contain regions that are not actually sensitive, but any such regions
|
|
|
|
// will be included in the mDispatchToContentHitRegion.
|
2013-12-16 14:47:06 +04:00
|
|
|
nsIntRegion mHitRegion;
|
2015-03-24 16:13:24 +03:00
|
|
|
// The mDispatchToContentHitRegion for a layer contains all areas for
|
|
|
|
// which the main-thread must be consulted before responding to events.
|
|
|
|
// This region will be a subregion of mHitRegion.
|
2013-12-16 14:47:06 +04:00
|
|
|
nsIntRegion mDispatchToContentHitRegion;
|
|
|
|
|
2015-03-24 16:13:24 +03:00
|
|
|
// The following regions represent the touch-action areas of this layer.
|
|
|
|
// All of these regions are approximations to the true region, but any
|
|
|
|
// variance between the approximation and the true region is guaranteed
|
|
|
|
// to be included in the mDispatchToContentHitRegion.
|
|
|
|
nsIntRegion mNoActionRegion;
|
|
|
|
nsIntRegion mHorizontalPanRegion;
|
|
|
|
nsIntRegion mVerticalPanRegion;
|
|
|
|
|
2014-11-14 15:40:14 +03:00
|
|
|
EventRegions()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
explicit EventRegions(nsIntRegion aHitRegion)
|
|
|
|
: mHitRegion(aHitRegion)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-08-18 20:06:30 +03:00
|
|
|
// This constructor takes the maybe-hit region and uses it to update the
|
|
|
|
// hit region and dispatch-to-content region. It is useful from converting
|
|
|
|
// from the display item representation to the layer representation.
|
|
|
|
EventRegions(const nsIntRegion& aHitRegion,
|
|
|
|
const nsIntRegion& aMaybeHitRegion,
|
|
|
|
const nsIntRegion& aDispatchToContentRegion,
|
|
|
|
const nsIntRegion& aNoActionRegion,
|
|
|
|
const nsIntRegion& aHorizontalPanRegion,
|
|
|
|
const nsIntRegion& aVerticalPanRegion);
|
|
|
|
|
2013-12-16 14:47:06 +04:00
|
|
|
bool operator==(const EventRegions& aRegions) const
|
|
|
|
{
|
|
|
|
return mHitRegion == aRegions.mHitRegion &&
|
2016-06-01 22:48:05 +03:00
|
|
|
mDispatchToContentHitRegion == aRegions.mDispatchToContentHitRegion &&
|
|
|
|
mNoActionRegion == aRegions.mNoActionRegion &&
|
|
|
|
mHorizontalPanRegion == aRegions.mHorizontalPanRegion &&
|
|
|
|
mVerticalPanRegion == aRegions.mVerticalPanRegion;
|
2013-12-16 14:47:06 +04:00
|
|
|
}
|
|
|
|
bool operator!=(const EventRegions& aRegions) const
|
|
|
|
{
|
|
|
|
return !(*this == aRegions);
|
|
|
|
}
|
|
|
|
|
2015-04-14 23:39:00 +03:00
|
|
|
void ApplyTranslationAndScale(float aXTrans, float aYTrans, float aXScale, float aYScale)
|
|
|
|
{
|
|
|
|
mHitRegion.ScaleRoundOut(aXScale, aYScale);
|
|
|
|
mDispatchToContentHitRegion.ScaleRoundOut(aXScale, aYScale);
|
|
|
|
mNoActionRegion.ScaleRoundOut(aXScale, aYScale);
|
|
|
|
mHorizontalPanRegion.ScaleRoundOut(aXScale, aYScale);
|
|
|
|
mVerticalPanRegion.ScaleRoundOut(aXScale, aYScale);
|
|
|
|
|
|
|
|
mHitRegion.MoveBy(aXTrans, aYTrans);
|
|
|
|
mDispatchToContentHitRegion.MoveBy(aXTrans, aYTrans);
|
|
|
|
mNoActionRegion.MoveBy(aXTrans, aYTrans);
|
|
|
|
mHorizontalPanRegion.MoveBy(aXTrans, aYTrans);
|
|
|
|
mVerticalPanRegion.MoveBy(aXTrans, aYTrans);
|
|
|
|
}
|
|
|
|
|
2015-07-11 03:06:35 +03:00
|
|
|
void Transform(const gfx::Matrix4x4& aTransform)
|
2014-11-14 15:40:14 +03:00
|
|
|
{
|
|
|
|
mHitRegion.Transform(aTransform);
|
|
|
|
mDispatchToContentHitRegion.Transform(aTransform);
|
2016-06-01 22:48:05 +03:00
|
|
|
mNoActionRegion.Transform(aTransform);
|
|
|
|
mHorizontalPanRegion.Transform(aTransform);
|
|
|
|
mVerticalPanRegion.Transform(aTransform);
|
2014-11-14 15:40:14 +03:00
|
|
|
}
|
|
|
|
|
2017-08-18 20:06:31 +03:00
|
|
|
void OrWith(const EventRegions& aOther)
|
|
|
|
{
|
|
|
|
mHitRegion.OrWith(aOther.mHitRegion);
|
|
|
|
mDispatchToContentHitRegion.OrWith(aOther.mDispatchToContentHitRegion);
|
|
|
|
// See the comment in nsDisplayList::AddFrame, where the touch action regions
|
|
|
|
// are handled. The same thing applies here.
|
|
|
|
bool alreadyHadRegions = !mNoActionRegion.IsEmpty() ||
|
|
|
|
!mHorizontalPanRegion.IsEmpty() ||
|
|
|
|
!mVerticalPanRegion.IsEmpty();
|
|
|
|
mNoActionRegion.OrWith(aOther.mNoActionRegion);
|
|
|
|
mHorizontalPanRegion.OrWith(aOther.mHorizontalPanRegion);
|
|
|
|
mVerticalPanRegion.OrWith(aOther.mVerticalPanRegion);
|
|
|
|
if (alreadyHadRegions) {
|
|
|
|
nsIntRegion combinedActionRegions;
|
|
|
|
combinedActionRegions.Or(mHorizontalPanRegion, mVerticalPanRegion);
|
|
|
|
combinedActionRegions.OrWith(mNoActionRegion);
|
|
|
|
mDispatchToContentHitRegion.OrWith(combinedActionRegions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-14 15:40:14 +03:00
|
|
|
bool IsEmpty() const
|
|
|
|
{
|
|
|
|
return mHitRegion.IsEmpty()
|
2016-06-01 22:48:05 +03:00
|
|
|
&& mDispatchToContentHitRegion.IsEmpty()
|
|
|
|
&& mNoActionRegion.IsEmpty()
|
|
|
|
&& mHorizontalPanRegion.IsEmpty()
|
|
|
|
&& mVerticalPanRegion.IsEmpty();
|
2014-11-14 15:40:14 +03:00
|
|
|
}
|
|
|
|
|
2017-08-18 20:06:31 +03:00
|
|
|
void SetEmpty()
|
|
|
|
{
|
|
|
|
mHitRegion.SetEmpty();
|
|
|
|
mDispatchToContentHitRegion.SetEmpty();
|
|
|
|
mNoActionRegion.SetEmpty();
|
|
|
|
mHorizontalPanRegion.SetEmpty();
|
|
|
|
mVerticalPanRegion.SetEmpty();
|
|
|
|
}
|
|
|
|
|
2013-12-16 14:47:06 +04:00
|
|
|
nsCString ToString() const
|
|
|
|
{
|
|
|
|
nsCString result = mHitRegion.ToString();
|
|
|
|
result.AppendLiteral(";dispatchToContent=");
|
|
|
|
result.Append(mDispatchToContentHitRegion.ToString());
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-02-17 05:30:02 +03:00
|
|
|
// Bit flags that go on a ContainerLayer (or RefLayer) and override the
|
|
|
|
// event regions in the entire subtree below. This is needed for propagating
|
|
|
|
// various flags across processes since the child-process layout code doesn't
|
|
|
|
// know about parent-process listeners or CSS rules.
|
|
|
|
enum EventRegionsOverride {
|
|
|
|
// The default, no flags set
|
|
|
|
NoOverride = 0,
|
|
|
|
// Treat all hit regions in the subtree as dispatch-to-content
|
|
|
|
ForceDispatchToContent = (1 << 0),
|
2015-02-17 05:30:02 +03:00
|
|
|
// Treat all hit regions in the subtree as empty
|
|
|
|
ForceEmptyHitRegion = (1 << 1),
|
2015-02-17 05:30:02 +03:00
|
|
|
// OR union of all valid bit flags, for use in BitFlagsEnumSerializer
|
2015-02-17 05:30:02 +03:00
|
|
|
ALL_BITS = (1 << 2) - 1
|
2015-02-17 05:30:02 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
MOZ_ALWAYS_INLINE EventRegionsOverride
|
|
|
|
operator|(EventRegionsOverride a, EventRegionsOverride b)
|
|
|
|
{
|
|
|
|
return (EventRegionsOverride)((int)a | (int)b);
|
|
|
|
}
|
|
|
|
|
|
|
|
MOZ_ALWAYS_INLINE EventRegionsOverride&
|
|
|
|
operator|=(EventRegionsOverride& a, EventRegionsOverride b)
|
|
|
|
{
|
|
|
|
a = a | b;
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2015-09-29 01:51:37 +03:00
|
|
|
// Flags used as an argument to functions that dump textures.
|
|
|
|
enum TextureDumpMode {
|
|
|
|
Compress, // dump texture with LZ4 compression
|
|
|
|
DoNotCompress // dump texture uncompressed
|
|
|
|
};
|
|
|
|
|
2016-01-07 02:56:25 +03:00
|
|
|
// Some specialized typedefs of Matrix4x4Typed.
|
|
|
|
typedef gfx::Matrix4x4Typed<LayerPixel, CSSTransformedLayerPixel> CSSTransformMatrix;
|
|
|
|
// Several different async transforms can contribute to a layer's transform
|
|
|
|
// (specifically, an async animation can contribute a transform, and each APZC
|
|
|
|
// that scrolls a layer can contribute async scroll/zoom and overscroll
|
|
|
|
// transforms).
|
|
|
|
// To try to model this with typed units, we represent individual async
|
|
|
|
// transforms as ParentLayer -> ParentLayer transforms (aliased as
|
|
|
|
// AsyncTransformComponentMatrix), and we represent the product of all of them
|
|
|
|
// as a CSSTransformLayer -> ParentLayer transform (aliased as
|
|
|
|
// AsyncTransformMatrix). To create an AsyncTransformMatrix from component
|
|
|
|
// matrices, a ViewAs operation is needed. A MultipleAsyncTransforms
|
|
|
|
// PixelCastJustification is provided for this purpose.
|
|
|
|
typedef gfx::Matrix4x4Typed<ParentLayerPixel, ParentLayerPixel> AsyncTransformComponentMatrix;
|
|
|
|
typedef gfx::Matrix4x4Typed<CSSTransformedLayerPixel, ParentLayerPixel> AsyncTransformMatrix;
|
|
|
|
|
2016-11-24 08:11:30 +03:00
|
|
|
typedef Array<gfx::Color, 4> BorderColors;
|
|
|
|
typedef Array<LayerSize, 4> BorderCorners;
|
|
|
|
typedef Array<LayerCoord, 4> BorderWidths;
|
2017-02-09 07:20:29 +03:00
|
|
|
typedef Array<uint8_t, 4> BorderStyles;
|
2016-11-24 08:11:30 +03:00
|
|
|
|
2017-06-02 10:11:34 +03:00
|
|
|
typedef Maybe<LayerRect> MaybeLayerRect;
|
|
|
|
|
2016-12-21 18:43:47 +03:00
|
|
|
// This is used to communicate Layers across IPC channels. The Handle is valid
|
|
|
|
// for layers in the same PLayerTransaction. Handles are created by ClientLayerManager,
|
|
|
|
// and are cached in LayerTransactionParent on first use.
|
|
|
|
class LayerHandle
|
|
|
|
{
|
|
|
|
friend struct IPC::ParamTraits<mozilla::layers::LayerHandle>;
|
|
|
|
public:
|
|
|
|
LayerHandle() : mHandle(0)
|
|
|
|
{}
|
|
|
|
LayerHandle(const LayerHandle& aOther) : mHandle(aOther.mHandle)
|
|
|
|
{}
|
|
|
|
explicit LayerHandle(uint64_t aHandle) : mHandle(aHandle)
|
|
|
|
{}
|
|
|
|
bool IsValid() const {
|
|
|
|
return mHandle != 0;
|
|
|
|
}
|
|
|
|
explicit operator bool() const {
|
|
|
|
return IsValid();
|
|
|
|
}
|
|
|
|
bool operator ==(const LayerHandle& aOther) const {
|
|
|
|
return mHandle == aOther.mHandle;
|
|
|
|
}
|
|
|
|
uint64_t Value() const {
|
|
|
|
return mHandle;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
uint64_t mHandle;
|
|
|
|
};
|
|
|
|
|
2017-01-18 05:47:05 +03:00
|
|
|
// This is used to communicate Compositables across IPC channels. The Handle is valid
|
|
|
|
// for layers in the same PLayerTransaction or PImageBridge. Handles are created by
|
|
|
|
// ClientLayerManager or ImageBridgeChild, and are cached in the parent side on first
|
|
|
|
// use.
|
|
|
|
class CompositableHandle
|
|
|
|
{
|
|
|
|
friend struct IPC::ParamTraits<mozilla::layers::CompositableHandle>;
|
|
|
|
public:
|
|
|
|
CompositableHandle() : mHandle(0)
|
|
|
|
{}
|
|
|
|
CompositableHandle(const CompositableHandle& aOther) : mHandle(aOther.mHandle)
|
|
|
|
{}
|
|
|
|
explicit CompositableHandle(uint64_t aHandle) : mHandle(aHandle)
|
|
|
|
{}
|
|
|
|
bool IsValid() const {
|
|
|
|
return mHandle != 0;
|
|
|
|
}
|
|
|
|
explicit operator bool() const {
|
|
|
|
return IsValid();
|
|
|
|
}
|
|
|
|
bool operator ==(const CompositableHandle& aOther) const {
|
|
|
|
return mHandle == aOther.mHandle;
|
|
|
|
}
|
|
|
|
uint64_t Value() const {
|
|
|
|
return mHandle;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
uint64_t mHandle;
|
|
|
|
};
|
|
|
|
|
2017-02-27 06:12:12 +03:00
|
|
|
class ReadLockHandle
|
|
|
|
{
|
|
|
|
friend struct IPC::ParamTraits<mozilla::layers::ReadLockHandle>;
|
|
|
|
public:
|
|
|
|
ReadLockHandle() : mHandle(0)
|
|
|
|
{}
|
|
|
|
ReadLockHandle(const ReadLockHandle& aOther) : mHandle(aOther.mHandle)
|
|
|
|
{}
|
|
|
|
explicit ReadLockHandle(uint64_t aHandle) : mHandle(aHandle)
|
|
|
|
{}
|
|
|
|
bool IsValid() const {
|
|
|
|
return mHandle != 0;
|
|
|
|
}
|
|
|
|
explicit operator bool() const {
|
|
|
|
return IsValid();
|
|
|
|
}
|
|
|
|
bool operator ==(const ReadLockHandle& aOther) const {
|
|
|
|
return mHandle == aOther.mHandle;
|
|
|
|
}
|
|
|
|
uint64_t Value() const {
|
|
|
|
return mHandle;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
uint64_t mHandle;
|
|
|
|
};
|
|
|
|
|
2017-07-01 04:18:55 +03:00
|
|
|
MOZ_DEFINE_ENUM_CLASS_WITH_BASE(ScrollDirection, uint32_t, (
|
2017-01-25 03:41:17 +03:00
|
|
|
NONE,
|
|
|
|
VERTICAL,
|
2017-07-01 04:18:55 +03:00
|
|
|
HORIZONTAL
|
|
|
|
));
|
2017-01-25 03:41:17 +03:00
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
2012-07-18 20:31:40 +04:00
|
|
|
|
2012-07-31 04:42:26 +04:00
|
|
|
#endif /* GFX_LAYERSTYPES_H */
|