-// Table for fast look-up of Dali::StencilOperation enum to a GL stencil operation.
-// Note: These MUST be in the same order as Dali::StencilOperation enum.
-const int DaliStencilOperationToGL[] = {GL_ZERO, GL_KEEP, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT, GL_INCR_WRAP, GL_DECR_WRAP};
+struct GraphicsStencilOp
+{
+ constexpr explicit GraphicsStencilOp(StencilOperation::Type stencilOp)
+ {
+ switch(stencilOp)
+ {
+ case Dali::StencilOperation::KEEP:
+ op = Graphics::StencilOp::KEEP;
+ break;
+ case Dali::StencilOperation::ZERO:
+ op = Graphics::StencilOp::ZERO;
+ break;
+ case Dali::StencilOperation::REPLACE:
+ op = Graphics::StencilOp::REPLACE;
+ break;
+ case Dali::StencilOperation::INCREMENT:
+ op = Graphics::StencilOp::INCREMENT_AND_CLAMP;
+ break;
+ case Dali::StencilOperation::DECREMENT:
+ op = Graphics::StencilOp::DECREMENT_AND_CLAMP;
+ break;
+ case Dali::StencilOperation::INVERT:
+ op = Graphics::StencilOp::INVERT;
+ break;
+ case Dali::StencilOperation::INCREMENT_WRAP:
+ op = Graphics::StencilOp::INCREMENT_AND_WRAP;
+ break;
+ case Dali::StencilOperation::DECREMENT_WRAP:
+ op = Graphics::StencilOp::DECREMENT_AND_WRAP;
+ break;
+ }
+ }
+ Graphics::StencilOp op{Graphics::StencilOp::KEEP};
+};