fune/gfx/layers/d3d11/BlendShaderConstants.h
Daniel Holbert 126bd9e1a4 Bug 1412427 part 8: (automated patch) Switch a bunch of C++ files in gfx to use our standard mode lines. r=jrmuizel
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: 77D61xpSmIl

--HG--
extra : rebase_source : c6162fa3cf539a07177a19838324bf368faa162b
2017-10-27 16:10:06 -07:00

61 lines
2.1 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef MOZILLA_GFX_LAYERS_D3D11_BLENDSHADERCONSTANTS_H_
#define MOZILLA_GFX_LAYERS_D3D11_BLENDSHADERCONSTANTS_H_
// These constants are shared between CompositorD3D11 and the blend pixel shader.
#define PS_LAYER_RGB 0
#define PS_LAYER_RGBA 1
#define PS_LAYER_YCBCR 2
#define PS_LAYER_COLOR 3
#define PS_LAYER_NV12 4
// These must be in the same order as the Mask enum.
#define PS_MASK_NONE 0
#define PS_MASK 1
// These must be in the same order as CompositionOp.
#define PS_BLEND_MULTIPLY 0
#define PS_BLEND_SCREEN 1
#define PS_BLEND_OVERLAY 2
#define PS_BLEND_DARKEN 3
#define PS_BLEND_LIGHTEN 4
#define PS_BLEND_COLOR_DODGE 5
#define PS_BLEND_COLOR_BURN 6
#define PS_BLEND_HARD_LIGHT 7
#define PS_BLEND_SOFT_LIGHT 8
#define PS_BLEND_DIFFERENCE 9
#define PS_BLEND_EXCLUSION 10
#define PS_BLEND_HUE 11
#define PS_BLEND_SATURATION 12
#define PS_BLEND_COLOR 13
#define PS_BLEND_LUMINOSITY 14
#if defined(__cplusplus)
namespace mozilla {
namespace layers {
static inline int
BlendOpToShaderConstant(gfx::CompositionOp aOp) {
return int(aOp) - int(gfx::CompositionOp::OP_MULTIPLY);
}
} // namespace layers
} // namespace mozilla
// Sanity checks.
namespace {
static inline void BlendShaderConstantAsserts() {
static_assert(PS_MASK_NONE == int(mozilla::layers::MaskType::MaskNone), "shader constant is out of sync");
static_assert(PS_MASK == int(mozilla::layers::MaskType::Mask), "shader constant is out of sync");
static_assert(int(mozilla::gfx::CompositionOp::OP_LUMINOSITY) - int(mozilla::gfx::CompositionOp::OP_MULTIPLY) == 14,
"shader constants are out of sync");
}
} // anonymous namespace
#endif
#endif // MOZILLA_GFX_LAYERS_D3D11_BLENDSHADERCONSTANTS_H_