From 067c9a9d5f8070482776e54a69249c449fb4e31b Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Wed, 9 Jan 2019 11:34:31 +0000 Subject: [PATCH] (FrameBuffer) Add Attachment enum boolean operator to allow it being used as a bool expression Fixes an SVACE error as well. Change-Id: Icfb3a970753b2a558854176e24580a222e8d6e2c --- dali/public-api/rendering/frame-buffer.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dali/public-api/rendering/frame-buffer.cpp b/dali/public-api/rendering/frame-buffer.cpp index 0b86092..89b0a53 100644 --- a/dali/public-api/rendering/frame-buffer.cpp +++ b/dali/public-api/rendering/frame-buffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use *this file except in compliance with the License. @@ -18,6 +18,9 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include // DALI_LOG_WARNING_NOFN #include // Dali::Internal::FrameBuffer @@ -26,6 +29,18 @@ namespace Dali { +namespace +{ +/// Bool operator for FrameBuffer::Attachment::Mask. +/// in cpp as only used in this file +bool operator&( FrameBuffer::Attachment::Mask lhs, FrameBuffer::Attachment::Mask rhs ) +{ + using UnderlyingType = typename std::underlying_type< FrameBuffer::Attachment::Mask >::type; + return static_cast( static_cast( lhs ) & static_cast( rhs ) ); +} + +} // unnamed namespace + FrameBuffer FrameBuffer::New( uint32_t width, uint32_t height ) { return New( width, height, FrameBuffer::Attachment::COLOR ); -- 2.7.4