Edit

kc3-lang/angle/src/common/Color.inl

Branch :

  • Show log

    Commit

  • Author : Shahbaz Youssefi
    Date : 2019-02-26 15:08:11
    Hash : 4d153383
    Message : Reland "Vulkan: Implement debug markers" This reverts commit 0c01e36783b20a0177c653490cb4f8ea4a896075. Reason for revert: Its dependency that was reverted has now relanded: https://chromium-review.googlesource.com/c/angle/angle/+/1489153 Original change's description: > Revert "Vulkan: Implement debug markers" > > This reverts commit 983e446921946734fe47217c345a8fe2f079319d. > > Reason for revert: Depends on a CL that's reverted: https://chromium-review.googlesource.com/c/angle/angle/+/1470605 > > Original change's description: > > Vulkan: Implement debug markers > > > > Covers both GL_KHR_debug and GL_EXT_debug_marker. > > > > Debug markers are used to specify events or hierarchically categorize a > > set of commands within the command buffer. When debugging, this allows > > for quicker navigation to the draw calls of interest, and otherwise > > provides context to debug output. > > > > Bug: angleproject:2853 > > Change-Id: Id65e11fc877d9e70b6fd0fae7f0bbbcb1164bf10 > > Reviewed-on: https://chromium-review.googlesource.com/c/1403956 > > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > > Reviewed-by: Jamie Madill <jmadill@chromium.org> > > Reviewed-by: Geoff Lang <geofflang@chromium.org> > > TBR=geofflang@chromium.org,jmadill@chromium.org,syoussefi@chromium.org > > Change-Id: I7fcfc8683195d396aec61848719f52c0fa049ece > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: angleproject:2853 > Reviewed-on: https://chromium-review.googlesource.com/c/1470606 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> TBR=geofflang@chromium.org,jmadill@google.com,syoussefi@chromium.org Bug: angleproject:2853 Change-Id: Ie19ae103244d54dcf7108d5f61c24e318fc44057 Reviewed-on: https://chromium-review.googlesource.com/c/1489154 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@google.com>

  • src/common/Color.inl
  • //
    // Copyright (c) 2016 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    
    // Color.inl : Inline definitions of some functions from Color.h
    
    namespace angle
    {
    
    template <typename T>
    Color<T>::Color() : Color(0, 0, 0, 0)
    {
    }
    
    template <typename T>
    constexpr Color<T>::Color(T r, T g, T b, T a) : red(r), green(g), blue(b), alpha(a)
    {
    }
    
    template <typename T>
    bool operator==(const Color<T> &a, const Color<T> &b)
    {
        return a.red == b.red &&
               a.green == b.green &&
               a.blue == b.blue &&
               a.alpha == b.alpha;
    }
    
    template <typename T>
    bool operator!=(const Color<T> &a, const Color<T> &b)
    {
        return !(a == b);
    }
    
    
    ColorGeneric::ColorGeneric() : colorF(), type(Type::Float) {}
    
    ColorGeneric::ColorGeneric(const ColorF &color) : colorF(color), type(Type::Float) {}
    
    ColorGeneric::ColorGeneric(const ColorI &color) : colorI(color), type(Type::Int) {}
    
    ColorGeneric::ColorGeneric(const ColorUI &color) : colorUI(color), type(Type::UInt) {}
    
    bool operator==(const ColorGeneric &a, const ColorGeneric &b)
    {
        if (a.type != b.type)
        {
            return false;
        }
        switch (a.type)
        {
            default:
            case ColorGeneric::Type::Float:
                return a.colorF == b.colorF;
            case ColorGeneric::Type::Int:
                return a.colorI == b.colorI;
            case ColorGeneric::Type::UInt:
                return a.colorUI == b.colorUI;
        }
    }
    
    bool operator!=(const ColorGeneric &a, const ColorGeneric &b)
    {
        return !(a == b);
    }
    
    }  // namespace angle