2012-07-18 09:31:40 -07: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-30 17:42:26 -07:00
|
|
|
#ifndef GFX_LAYERSTYPES_H
|
|
|
|
#define GFX_LAYERSTYPES_H
|
2012-07-18 09:31:40 -07:00
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <stdint.h> // for uint32_t
|
|
|
|
#include "nsPoint.h" // for nsIntPoint
|
2013-12-16 02:47:06 -08:00
|
|
|
#include "nsRegion.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
|
2014-04-25 19:34:05 -07:00
|
|
|
#include "mozilla/TypedEnumBits.h"
|
2014-01-23 10:26:41 -08:00
|
|
|
|
2013-06-05 15:14:51 -07:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
|
|
|
#include <ui/GraphicBuffer.h>
|
|
|
|
#endif
|
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 02:20:52 -07:00
|
|
|
#if defined(DEBUG) || defined(PR_LOGGING)
|
|
|
|
# include <stdio.h> // FILE
|
2013-08-11 16:17:23 -07:00
|
|
|
# include "prlog.h" // for PR_LOG
|
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 02:20:52 -07:00
|
|
|
# ifndef MOZ_LAYERS_HAVE_LOG
|
|
|
|
# define MOZ_LAYERS_HAVE_LOG
|
|
|
|
# endif
|
|
|
|
# define MOZ_LAYERS_LOG(_args) \
|
|
|
|
PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args)
|
|
|
|
# define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args) \
|
|
|
|
do { if (layer->AsShadowableLayer()) { PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args); } } while (0)
|
|
|
|
#else
|
|
|
|
struct PRLogModuleInfo;
|
|
|
|
# define MOZ_LAYERS_LOG(_args)
|
|
|
|
# define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args)
|
|
|
|
#endif // if defined(DEBUG) || defined(PR_LOGGING)
|
|
|
|
|
2014-08-18 19:14:00 -07:00
|
|
|
#define INVALID_OVERLAY -1
|
|
|
|
|
2013-06-05 15:14:51 -07:00
|
|
|
namespace android {
|
|
|
|
class GraphicBuffer;
|
|
|
|
}
|
|
|
|
|
2012-07-18 09:31:40 -07: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 02:20:52 -07:00
|
|
|
|
2014-02-24 20:23:41 -08: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 02:20:52 -07:00
|
|
|
|
2014-01-23 10:26:41 -08:00
|
|
|
#undef NONE
|
|
|
|
#undef OPAQUE
|
|
|
|
|
2015-01-25 14:22:07 -08:00
|
|
|
enum class LayersBackend : int8_t {
|
2012-07-18 09:31:40 -07:00
|
|
|
LAYERS_NONE = 0,
|
|
|
|
LAYERS_BASIC,
|
|
|
|
LAYERS_OPENGL,
|
|
|
|
LAYERS_D3D9,
|
|
|
|
LAYERS_D3D10,
|
2013-05-03 10:34:29 -07:00
|
|
|
LAYERS_D3D11,
|
2013-04-30 22:03:25 -07:00
|
|
|
LAYERS_CLIENT,
|
2012-07-18 09:31:40 -07:00
|
|
|
LAYERS_LAST
|
2015-01-25 14:22:07 -08:00
|
|
|
};
|
2012-07-30 17:42:26 -07:00
|
|
|
|
2015-01-25 14:22:07 -08:00
|
|
|
enum class BufferMode : int8_t {
|
2012-07-30 17:42:26 -07:00
|
|
|
BUFFER_NONE,
|
2014-01-23 10:26:41 -08:00
|
|
|
BUFFERED
|
2015-01-25 14:22:07 -08:00
|
|
|
};
|
2012-07-30 17:42:26 -07:00
|
|
|
|
2015-01-25 14:22:07 -08:00
|
|
|
enum class DrawRegionClip : int8_t {
|
2014-01-23 10:26:41 -08:00
|
|
|
DRAW,
|
2014-09-30 22:25:25 -07:00
|
|
|
NONE
|
2015-01-25 14:22:07 -08:00
|
|
|
};
|
2013-11-06 11:10:50 -08:00
|
|
|
|
2015-01-25 14:22:07 -08:00
|
|
|
enum class SurfaceMode : int8_t {
|
2014-01-17 06:00:00 -08:00
|
|
|
SURFACE_NONE = 0,
|
|
|
|
SURFACE_OPAQUE,
|
|
|
|
SURFACE_SINGLE_CHANNEL_ALPHA,
|
|
|
|
SURFACE_COMPONENT_ALPHA
|
2015-01-25 14:22:07 -08:00
|
|
|
};
|
2014-01-17 06:00:00 -08:00
|
|
|
|
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 02:20:52 -07:00
|
|
|
// LayerRenderState for Composer2D
|
2013-06-05 15:14:51 -07:00
|
|
|
// We currently only support Composer2D using gralloc. If we want to be backed
|
|
|
|
// by other surfaces we will need a more generic LayerRenderState.
|
2015-01-25 14:22:07 -08:00
|
|
|
enum class LayerRenderStateFlags : int8_t {
|
2014-04-25 19:34:05 -07:00
|
|
|
LAYER_RENDER_STATE_DEFAULT = 0,
|
2014-11-17 17:02:19 -08:00
|
|
|
ORIGIN_BOTTOM_LEFT = 1 << 0,
|
2014-04-25 19:34:05 -07:00
|
|
|
BUFFER_ROTATION = 1 << 1,
|
2013-06-11 03:14:33 -07:00
|
|
|
// Notify Composer2D to swap the RB pixels of gralloc buffer
|
2014-10-29 19:32:41 -07:00
|
|
|
FORMAT_RB_SWAP = 1 << 2,
|
|
|
|
// We record opaqueness here alongside the actual surface we're going to
|
|
|
|
// render. This avoids confusion when a layer might return different kinds
|
|
|
|
// of surfaces over time (e.g. video frames).
|
|
|
|
OPAQUE = 1 << 3
|
2015-01-25 14:22:07 -08:00
|
|
|
};
|
2014-04-25 19:34:05 -07:00
|
|
|
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(LayerRenderStateFlags)
|
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 02:20:52 -07:00
|
|
|
|
2013-06-05 15:14:51 -07:00
|
|
|
// The 'ifdef MOZ_WIDGET_GONK' sadness here is because we don't want to include
|
|
|
|
// android::sp unless we have to.
|
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 02:20:52 -07:00
|
|
|
struct LayerRenderState {
|
2013-06-05 15:14:51 -07:00
|
|
|
LayerRenderState()
|
|
|
|
#ifdef MOZ_WIDGET_GONK
|
2014-04-25 19:34:05 -07:00
|
|
|
: mFlags(LayerRenderStateFlags::LAYER_RENDER_STATE_DEFAULT)
|
|
|
|
, mHasOwnOffset(false)
|
|
|
|
, mSurface(nullptr)
|
2014-08-18 19:14:00 -07:00
|
|
|
, mOverlayId(INVALID_OVERLAY)
|
2014-04-25 19:34:05 -07:00
|
|
|
, mTexture(nullptr)
|
2013-06-05 15:14:51 -07:00
|
|
|
#endif
|
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 02:20:52 -07:00
|
|
|
{}
|
|
|
|
|
2013-06-05 15:14:51 -07:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
|
|
|
LayerRenderState(android::GraphicBuffer* aSurface,
|
|
|
|
const nsIntSize& aSize,
|
2014-04-25 19:34:05 -07:00
|
|
|
LayerRenderStateFlags aFlags,
|
2014-02-24 20:23:41 -08:00
|
|
|
TextureHost* aTexture)
|
2014-04-25 19:34:05 -07:00
|
|
|
: mFlags(aFlags)
|
|
|
|
, mHasOwnOffset(false)
|
|
|
|
, mSurface(aSurface)
|
2014-08-18 19:14:00 -07:00
|
|
|
, mOverlayId(INVALID_OVERLAY)
|
2013-06-05 15:14:51 -07:00
|
|
|
, mSize(aSize)
|
2014-03-03 00:15:00 -08:00
|
|
|
, mTexture(aTexture)
|
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 02:20:52 -07:00
|
|
|
{}
|
|
|
|
|
2014-11-17 17:02:19 -08:00
|
|
|
bool OriginBottomLeft() const
|
|
|
|
{ return bool(mFlags & LayerRenderStateFlags::ORIGIN_BOTTOM_LEFT); }
|
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 02:20:52 -07:00
|
|
|
|
|
|
|
bool BufferRotated() const
|
2014-04-25 19:34:05 -07:00
|
|
|
{ return bool(mFlags & LayerRenderStateFlags::BUFFER_ROTATION); }
|
2013-06-11 03:14:33 -07:00
|
|
|
|
|
|
|
bool FormatRBSwapped() const
|
2014-04-25 19:34:05 -07:00
|
|
|
{ return bool(mFlags & LayerRenderStateFlags::FORMAT_RB_SWAP); }
|
2014-08-18 19:14:00 -07:00
|
|
|
|
|
|
|
void SetOverlayId(const int32_t& aId)
|
|
|
|
{ mOverlayId = aId; }
|
2013-06-05 15:14:51 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void SetOffset(const nsIntPoint& aOffset)
|
|
|
|
{
|
|
|
|
mOffset = aOffset;
|
|
|
|
mHasOwnOffset = true;
|
|
|
|
}
|
|
|
|
|
2014-04-25 19:34:05 -07:00
|
|
|
// see LayerRenderStateFlags
|
|
|
|
LayerRenderStateFlags mFlags;
|
|
|
|
// true if mOffset is applicable
|
|
|
|
bool mHasOwnOffset;
|
|
|
|
// the location of the layer's origin on mSurface
|
|
|
|
nsIntPoint mOffset;
|
2013-06-05 15:14:51 -07:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
|
|
|
// surface to render
|
|
|
|
android::sp<android::GraphicBuffer> mSurface;
|
2014-08-18 19:14:00 -07:00
|
|
|
int32_t mOverlayId;
|
|
|
|
// size of mSurface
|
2013-06-05 15:14:51 -07:00
|
|
|
nsIntSize mSize;
|
2014-02-24 20:23:41 -08:00
|
|
|
TextureHost* mTexture;
|
2013-06-05 15:14:51 -07:00
|
|
|
#endif
|
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 02:20:52 -07:00
|
|
|
};
|
|
|
|
|
2015-01-25 14:22:07 -08:00
|
|
|
enum class ScaleMode : int8_t {
|
2013-08-20 12:45:30 -07:00
|
|
|
SCALE_NONE,
|
2014-01-23 10:26:41 -08:00
|
|
|
STRETCH,
|
|
|
|
SENTINEL
|
|
|
|
// Unimplemented - PRESERVE_ASPECT_RATIO_CONTAIN
|
2015-01-25 14:22:07 -08:00
|
|
|
};
|
2013-08-20 12:45:30 -07:00
|
|
|
|
2013-12-16 02:47:06 -08:00
|
|
|
struct EventRegions {
|
2015-03-24 06:13:24 -07: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 02:47:06 -08:00
|
|
|
nsIntRegion mHitRegion;
|
2015-03-24 06:13:24 -07: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 02:47:06 -08:00
|
|
|
nsIntRegion mDispatchToContentHitRegion;
|
|
|
|
|
2015-03-24 06:13:24 -07: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 04:40:14 -08:00
|
|
|
EventRegions()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
explicit EventRegions(nsIntRegion aHitRegion)
|
|
|
|
: mHitRegion(aHitRegion)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-12-16 02:47:06 -08:00
|
|
|
bool operator==(const EventRegions& aRegions) const
|
|
|
|
{
|
|
|
|
return mHitRegion == aRegions.mHitRegion &&
|
|
|
|
mDispatchToContentHitRegion == aRegions.mDispatchToContentHitRegion;
|
|
|
|
}
|
|
|
|
bool operator!=(const EventRegions& aRegions) const
|
|
|
|
{
|
|
|
|
return !(*this == aRegions);
|
|
|
|
}
|
|
|
|
|
2014-11-14 04:40:14 -08:00
|
|
|
void OrWith(const EventRegions& aOther)
|
|
|
|
{
|
|
|
|
mHitRegion.OrWith(aOther.mHitRegion);
|
|
|
|
mDispatchToContentHitRegion.OrWith(aOther.mDispatchToContentHitRegion);
|
|
|
|
}
|
|
|
|
|
2014-11-14 04:40:14 -08:00
|
|
|
void AndWith(const nsIntRegion& aRegion)
|
|
|
|
{
|
|
|
|
mHitRegion.AndWith(aRegion);
|
|
|
|
mDispatchToContentHitRegion.AndWith(aRegion);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Sub(const EventRegions& aMinuend, const nsIntRegion& aSubtrahend)
|
|
|
|
{
|
|
|
|
mHitRegion.Sub(aMinuend.mHitRegion, aSubtrahend);
|
|
|
|
mDispatchToContentHitRegion.Sub(aMinuend.mDispatchToContentHitRegion, aSubtrahend);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Transform(const gfx3DMatrix& aTransform)
|
|
|
|
{
|
|
|
|
mHitRegion.Transform(aTransform);
|
|
|
|
mDispatchToContentHitRegion.Transform(aTransform);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsEmpty() const
|
|
|
|
{
|
|
|
|
return mHitRegion.IsEmpty()
|
|
|
|
&& mDispatchToContentHitRegion.IsEmpty();
|
|
|
|
}
|
|
|
|
|
2013-12-16 02:47:06 -08:00
|
|
|
nsCString ToString() const
|
|
|
|
{
|
|
|
|
nsCString result = mHitRegion.ToString();
|
|
|
|
result.AppendLiteral(";dispatchToContent=");
|
|
|
|
result.Append(mDispatchToContentHitRegion.ToString());
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-02-16 18:30:02 -08: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-16 18:30:02 -08:00
|
|
|
// Treat all hit regions in the subtree as empty
|
|
|
|
ForceEmptyHitRegion = (1 << 1),
|
2015-02-16 18:30:02 -08:00
|
|
|
// OR union of all valid bit flags, for use in BitFlagsEnumSerializer
|
2015-02-16 18:30:02 -08:00
|
|
|
ALL_BITS = (1 << 2) - 1
|
2015-02-16 18:30:02 -08: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;
|
|
|
|
}
|
|
|
|
|
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 02:20:52 -07:00
|
|
|
} // namespace
|
|
|
|
} // namespace
|
2012-07-18 09:31:40 -07:00
|
|
|
|
2012-07-30 17:42:26 -07:00
|
|
|
#endif /* GFX_LAYERSTYPES_H */
|