Bug 853551 - Implement the doppler part of AudioPannerNode. r=ehsan
[gecko.git] / gfx / layers / LayersTypes.h
blobca259e77aaf39237424c81f5bc566bf88ea1e30a
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GFX_LAYERSTYPES_H
7 #define GFX_LAYERSTYPES_H
9 #include "nsPoint.h"
11 #if defined(DEBUG) || defined(PR_LOGGING)
12 # include <stdio.h> // FILE
13 # include "prlog.h"
14 # ifndef MOZ_LAYERS_HAVE_LOG
15 # define MOZ_LAYERS_HAVE_LOG
16 # endif
17 # define MOZ_LAYERS_LOG(_args) \
18 PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args)
19 # define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args) \
20 do { if (layer->AsShadowableLayer()) { PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args); } } while (0)
21 #else
22 struct PRLogModuleInfo;
23 # define MOZ_LAYERS_LOG(_args)
24 # define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args)
25 #endif // if defined(DEBUG) || defined(PR_LOGGING)
27 namespace mozilla {
28 namespace layers {
30 class SurfaceDescriptor;
32 typedef uint32_t TextureFlags;
34 enum LayersBackend {
35 LAYERS_NONE = 0,
36 LAYERS_BASIC,
37 LAYERS_OPENGL,
38 LAYERS_D3D9,
39 LAYERS_D3D10,
40 LAYERS_LAST
43 enum BufferMode {
44 BUFFER_NONE,
45 BUFFER_BUFFERED
48 // The kinds of mask layer a shader can support
49 // We rely on the items in this enum being sequential
50 enum MaskType {
51 MaskNone = 0, // no mask layer
52 Mask2d, // mask layer for layers with 2D transforms
53 Mask3d, // mask layer for layers with 3D transforms
54 NumMaskTypes
57 // LayerRenderState for Composer2D
58 enum LayerRenderStateFlags {
59 LAYER_RENDER_STATE_Y_FLIPPED = 1 << 0,
60 LAYER_RENDER_STATE_BUFFER_ROTATION = 1 << 1
63 struct LayerRenderState {
64 LayerRenderState() : mSurface(nullptr), mFlags(0), mHasOwnOffset(false)
67 LayerRenderState(SurfaceDescriptor* aSurface, uint32_t aFlags = 0)
68 : mSurface(aSurface)
69 , mFlags(aFlags)
70 , mHasOwnOffset(false)
73 LayerRenderState(SurfaceDescriptor* aSurface, nsIntPoint aOffset, uint32_t aFlags = 0)
74 : mSurface(aSurface)
75 , mFlags(aFlags)
76 , mOffset(aOffset)
77 , mHasOwnOffset(true)
80 bool YFlipped() const
81 { return mFlags & LAYER_RENDER_STATE_Y_FLIPPED; }
83 bool BufferRotated() const
84 { return mFlags & LAYER_RENDER_STATE_BUFFER_ROTATION; }
86 SurfaceDescriptor* mSurface;
87 uint32_t mFlags;
88 nsIntPoint mOffset;
89 bool mHasOwnOffset;
92 } // namespace
93 } // namespace
95 #endif /* GFX_LAYERSTYPES_H */