Merge "Clean up the code to build successfully on macOS" into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / common / blending-options.h
index 1e15e2f..f150685 100644 (file)
@@ -1,25 +1,28 @@
-#ifndef __DALI_BLENDING_OPTIONS_H__
-#define __DALI_BLENDING_OPTIONS_H__
-
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+#ifndef DALI_BLENDING_OPTIONS_H
+#define DALI_BLENDING_OPTIONS_H
+
+/*
+ * Copyright (c) 2020 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/actors/blending.h>
+#include <dali/public-api/rendering/renderer.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/public-api/math/vector4.h>
+#include <dali/internal/common/owner-pointer.h>
 
 namespace Dali
 {
@@ -55,50 +58,50 @@ struct BlendingOptions
   /**
    * @copydoc Dali::RenderableActor::SetBlendFunc()
    */
-  void SetBlendFunc( BlendingFactor::Type srcFactorRgb,   BlendingFactor::Type destFactorRgb,
-                     BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha );
+  void SetBlendFunc( BlendFactor::Type srcFactorRgb,   BlendFactor::Type destFactorRgb,
+                     BlendFactor::Type srcFactorAlpha, BlendFactor::Type destFactorAlpha );
 
   /**
    * @copydoc Dali::RenderableActor::GetBlendFunc()
    */
-  BlendingFactor::Type GetBlendSrcFactorRgb() const;
+  BlendFactor::Type GetBlendSrcFactorRgb() const;
 
   /**
    * @copydoc Dali::RenderableActor::GetBlendFunc()
    */
-  BlendingFactor::Type GetBlendDestFactorRgb() const;
+  BlendFactor::Type GetBlendDestFactorRgb() const;
 
   /**
    * @copydoc Dali::RenderableActor::GetBlendFunc()
    */
-  BlendingFactor::Type GetBlendSrcFactorAlpha() const;
+  BlendFactor::Type GetBlendSrcFactorAlpha() const;
 
   /**
    * @copydoc Dali::RenderableActor::GetBlendFunc()
    */
-  BlendingFactor::Type GetBlendDestFactorAlpha() const;
+  BlendFactor::Type GetBlendDestFactorAlpha() const;
 
   /**
    * @copydoc Dali::RenderableActor::SetBlendEquation()
    */
-  void SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha );
+  void SetBlendEquation( DevelBlendEquation::Type equationRgb, DevelBlendEquation::Type equationAlpha );
 
   /**
    * @copydoc Dali::RenderableActor::GetBlendEquation()
    */
-  BlendingEquation::Type GetBlendEquationRgb() const;
+  DevelBlendEquation::Type GetBlendEquationRgb() const;
 
   /**
    * @copydoc Dali::RenderableActor::GetBlendEquation()
    */
-  BlendingEquation::Type GetBlendEquationAlpha() const;
+  DevelBlendEquation::Type GetBlendEquationAlpha() const;
 
   /**
    * Set the blend color.
    * @param[in] color The blend color.
    * @return True if the blend color changed, otherwise it was already the same color.
    */
-  bool SetBlendColor( const Vector4& color );
+  void SetBlendColor( const Vector4& color );
 
   /**
    * Query the blend color.
@@ -106,6 +109,18 @@ struct BlendingOptions
    */
   const Vector4* GetBlendColor() const;
 
+  /**
+   * Query whether current blend equation is advanced option.
+   * @return True if current blend equation is advanced.
+   */
+  bool IsAdvancedBlendEquationApplied();
+
+  /**
+   * Query whether input blend equation is advanced option.
+   * @return True if input blend equation is advanced.
+   */
+  static bool IsAdvancedBlendEquation( DevelBlendEquation::Type equation );
+
 private:
 
   // Undefined copy constructor.
@@ -118,11 +133,12 @@ private:
 
   unsigned int mBitmask; ///< A bitmask of blending options
 
-  Vector4* mOptionalColor; ///< A heap-allocated color (owned)
+  OwnerPointer< Vector4> mBlendColor; ///< A heap-allocated color (owned)
+
 };
 
 } // namespace Internal
 
 } // namespace Dali
 
-#endif // __DALI_BLENDING_OPTIONS_H__
+#endif // DALI_BLENDING_OPTIONS_H