gfx/gl/SurfaceTypes.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/gl/SurfaceTypes.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,117 @@
     1.4 +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef SURFACE_TYPES_H_
    1.10 +#define SURFACE_TYPES_H_
    1.11 +
    1.12 +#include "mozilla/TypedEnum.h"
    1.13 +#include "mozilla/RefPtr.h"
    1.14 +#include "mozilla/Attributes.h"
    1.15 +#include <stdint.h>
    1.16 +
    1.17 +namespace mozilla {
    1.18 +namespace layers {
    1.19 +class ISurfaceAllocator;
    1.20 +}
    1.21 +
    1.22 +namespace gfx {
    1.23 +
    1.24 +typedef uintptr_t SurfaceStreamHandle;
    1.25 +
    1.26 +struct SurfaceCaps MOZ_FINAL
    1.27 +{
    1.28 +    bool any;
    1.29 +    bool color, alpha;
    1.30 +    bool bpp16;
    1.31 +    bool depth, stencil;
    1.32 +    bool antialias;
    1.33 +    bool preserve;
    1.34 +
    1.35 +    // The surface allocator that we want to create this
    1.36 +    // for.  May be null.
    1.37 +    RefPtr<layers::ISurfaceAllocator> surfaceAllocator;
    1.38 +
    1.39 +    SurfaceCaps();
    1.40 +    SurfaceCaps(const SurfaceCaps& other);
    1.41 +    ~SurfaceCaps();
    1.42 +
    1.43 +    void Clear();
    1.44 +
    1.45 +    SurfaceCaps& operator=(const SurfaceCaps& other);
    1.46 +
    1.47 +    // We can't use just 'RGB' here, since it's an ancient Windows macro.
    1.48 +    static SurfaceCaps ForRGB() {
    1.49 +        SurfaceCaps caps;
    1.50 +
    1.51 +        caps.color = true;
    1.52 +
    1.53 +        return caps;
    1.54 +    }
    1.55 +
    1.56 +    static SurfaceCaps ForRGBA() {
    1.57 +        SurfaceCaps caps;
    1.58 +
    1.59 +        caps.color = true;
    1.60 +        caps.alpha = true;
    1.61 +
    1.62 +        return caps;
    1.63 +    }
    1.64 +
    1.65 +    static SurfaceCaps Any() {
    1.66 +        SurfaceCaps caps;
    1.67 +
    1.68 +        caps.any = true;
    1.69 +
    1.70 +        return caps;
    1.71 +    }
    1.72 +};
    1.73 +
    1.74 +MOZ_BEGIN_ENUM_CLASS(SharedSurfaceType, uint8_t)
    1.75 +    Unknown = 0,
    1.76 +
    1.77 +    Basic,
    1.78 +    GLTextureShare,
    1.79 +    EGLImageShare,
    1.80 +    EGLSurfaceANGLE,
    1.81 +    DXGLInterop,
    1.82 +    DXGLInterop2,
    1.83 +    Gralloc,
    1.84 +    IOSurface,
    1.85 +
    1.86 +    Max
    1.87 +MOZ_END_ENUM_CLASS(SharedSurfaceType)
    1.88 +
    1.89 +
    1.90 +MOZ_BEGIN_ENUM_CLASS(SurfaceStreamType, uint8_t)
    1.91 +    SingleBuffer,
    1.92 +    TripleBuffer_Copy,
    1.93 +    TripleBuffer_Async,
    1.94 +    TripleBuffer,
    1.95 +    Max
    1.96 +MOZ_END_ENUM_CLASS(SurfaceStreamType)
    1.97 +
    1.98 +
    1.99 +MOZ_BEGIN_ENUM_CLASS(APITypeT, uint8_t)
   1.100 +    Generic = 0,
   1.101 +
   1.102 +    OpenGL,
   1.103 +
   1.104 +    Max
   1.105 +MOZ_END_ENUM_CLASS(APITypeT)
   1.106 +
   1.107 +
   1.108 +MOZ_BEGIN_ENUM_CLASS(AttachmentType, uint8_t)
   1.109 +    Screen = 0,
   1.110 +
   1.111 +    GLTexture,
   1.112 +    GLRenderbuffer,
   1.113 +
   1.114 +    Max
   1.115 +MOZ_END_ENUM_CLASS(AttachmentType)
   1.116 +
   1.117 +} /* namespace gfx */
   1.118 +} /* namespace mozilla */
   1.119 +
   1.120 +#endif /* SURFACE_TYPES_H_ */

mercurial