Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/canvas/WebGLExtensionDepthTexture.cpp
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/. */
5
6
#include "WebGLExtensions.h"
7
8
#include "GLContext.h"
9
#include "mozilla/dom/WebGLRenderingContextBinding.h"
10
#include "WebGLContext.h"
11
12
namespace mozilla {
13
14
WebGLExtensionDepthTexture::WebGLExtensionDepthTexture(WebGLContext* webgl)
15
    : WebGLExtensionBase(webgl)
16
0
{
17
0
    auto& fua = webgl->mFormatUsage;
18
0
19
0
    const auto fnAdd = [&fua](webgl::EffectiveFormat effFormat, GLenum unpackFormat,
20
0
                              GLenum unpackType)
21
0
    {
22
0
        auto usage = fua->EditUsage(effFormat);
23
0
        usage->isFilterable = true;
24
0
        usage->SetRenderable();
25
0
26
0
        const webgl::PackingInfo pi = {unpackFormat, unpackType};
27
0
        const webgl::DriverUnpackInfo dui = {unpackFormat, unpackFormat, unpackType};
28
0
        fua->AddTexUnpack(usage, pi, dui);
29
0
30
0
        fua->AllowUnsizedTexFormat(pi, usage);
31
0
    };
32
0
33
0
    fnAdd(webgl::EffectiveFormat::DEPTH_COMPONENT16, LOCAL_GL_DEPTH_COMPONENT,
34
0
          LOCAL_GL_UNSIGNED_SHORT);
35
0
36
0
    fnAdd(webgl::EffectiveFormat::DEPTH_COMPONENT24, LOCAL_GL_DEPTH_COMPONENT,
37
0
          LOCAL_GL_UNSIGNED_INT);
38
0
39
0
    fnAdd(webgl::EffectiveFormat::DEPTH24_STENCIL8, LOCAL_GL_DEPTH_STENCIL,
40
0
          LOCAL_GL_UNSIGNED_INT_24_8);
41
0
}
42
43
WebGLExtensionDepthTexture::~WebGLExtensionDepthTexture()
44
0
{
45
0
}
46
47
IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionDepthTexture, WEBGL_depth_texture)
48
49
} // namespace mozilla