Skip to content

Commit

Permalink
docs: Added reference to OpenGL and Vulkan extensions
Browse files Browse the repository at this point in the history
Also renamed "Plus" to "Add" since it should be more recognizable.
  • Loading branch information
bjorn committed Jan 20, 2025
1 parent 79dea1f commit a084eef
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
9 changes: 8 additions & 1 deletion docs/manual/layers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ calculation details.
Mode SVG equivalent
=========== ===========================================================================
Normal `src-over <https://www.w3.org/TR/SVGCompositing/#comp-op-src-over>`__
Plus `plus <https://www.w3.org/TR/SVGCompositing/#comp-op-plus>`__
Add `plus <https://www.w3.org/TR/SVGCompositing/#comp-op-plus>`__
Multiply `multiply <https://www.w3.org/TR/SVGCompositing/#comp-op-multiply>`__
Screen `screen <https://www.w3.org/TR/SVGCompositing/#comp-op-screen>`__
Overlay `overlay <https://www.w3.org/TR/SVGCompositing/#comp-op-overlay>`__
Expand All @@ -249,6 +249,13 @@ Difference `difference <https://www.w3.org/TR/SVGCompositing/#comp-op-differen
Exclusion `exclusion <https://www.w3.org/TR/SVGCompositing/#comp-op-exclusion>`__
=========== ===========================================================================

In OpenGL, these blend modes can be implemented using ``glBlendEquation`` with
values from the `KHR_blend_equation_advanced
<https://registry.khronos.org/OpenGL/extensions/KHR/KHR_blend_equation_advanced.txt>`__
extension. In Vulkan, they are part of the `VK_EXT_blend_operation_advanced
<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_blend_operation_advanced>`__
extension.


.. topic:: Future Extensions
:class: future
Expand Down
2 changes: 1 addition & 1 deletion docs/scripting-doc/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2753,7 +2753,7 @@ declare enum BlendMode {
/** SVG equivalant: [src-over](https://www.w3.org/TR/SVGCompositing/#comp-op-src-over) */
Normal,
/** SVG equivalant: [plus](https://www.w3.org/TR/SVGCompositing/#comp-op-plus) */
Plus,
Add,
/** SVG equivalant: [multiply](https://www.w3.org/TR/SVGCompositing/#comp-op-multiply) */
Multiply,
/** SVG equivalant: [screen](https://www.w3.org/TR/SVGCompositing/#comp-op-screen) */
Expand Down
2 changes: 1 addition & 1 deletion src/libtiled/tiled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static constexpr struct BlendModeMapping {
const char *name;
} blendModeMapping[] = {
{ Tiled::BlendMode::Normal, "normal" },
{ Tiled::BlendMode::Plus, "plus" },
{ Tiled::BlendMode::Add, "add" },
{ Tiled::BlendMode::Multiply, "multiply" },
{ Tiled::BlendMode::Screen, "screen" },
{ Tiled::BlendMode::Overlay, "overlay" },
Expand Down
2 changes: 1 addition & 1 deletion src/libtiled/tiled.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ enum class BlendMode {
Normal = QPainter::CompositionMode_SourceOver,

// For now we only support the SVG 1.2 blend modes
Plus = QPainter::CompositionMode_Plus,
Add = QPainter::CompositionMode_Plus,
Multiply = QPainter::CompositionMode_Multiply,
Screen = QPainter::CompositionMode_Screen,
Overlay = QPainter::CompositionMode_Overlay,
Expand Down
2 changes: 1 addition & 1 deletion src/tiled/editablelayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace BlendModeNS {

enum Value {
Normal = static_cast<int>(BlendMode::Normal),
Plus = static_cast<int>(BlendMode::Plus),
Add = static_cast<int>(BlendMode::Add),
Multiply = static_cast<int>(BlendMode::Multiply),
Screen = static_cast<int>(BlendMode::Screen),
Overlay = static_cast<int>(BlendMode::Overlay),
Expand Down
4 changes: 2 additions & 2 deletions src/tiled/propertieswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ template<> EnumData enumData<BlendMode>()
{
const QStringList names {
QCoreApplication::translate("BlendMode", "Normal"),
QCoreApplication::translate("BlendMode", "Plus"),
QCoreApplication::translate("BlendMode", "Add"),
QCoreApplication::translate("BlendMode", "Multiply"),
QCoreApplication::translate("BlendMode", "Screen"),
QCoreApplication::translate("BlendMode", "Overlay"),
Expand All @@ -214,7 +214,7 @@ template<> EnumData enumData<BlendMode>()
};
static const QList<int> values {
static_cast<int>(BlendMode::Normal),
static_cast<int>(BlendMode::Plus),
static_cast<int>(BlendMode::Add),
static_cast<int>(BlendMode::Multiply),
static_cast<int>(BlendMode::Screen),
static_cast<int>(BlendMode::Overlay),
Expand Down

0 comments on commit a084eef

Please sign in to comment.