convert canvas::IRenderModule::PrimitiveType to scoped enum

Change-Id: Idf2e7449ce5b595386f437597ce7ccf00d141db0
Reviewed-on: https://gerrit.libreoffice.org/22634
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin
2016-02-23 10:08:40 +02:00
committed by Noel Grandin
parent 93de1f80e8
commit 81b7de3d9f
3 changed files with 12 additions and 12 deletions

View File

@@ -501,7 +501,7 @@ namespace dxcanvas
mnBeginSceneCount(0), mnBeginSceneCount(0),
mbCanUseDynamicTextures(false), mbCanUseDynamicTextures(false),
mbError( false ), mbError( false ),
meType( PRIMITIVE_TYPE_UNKNOWN ), meType( PrimitiveType::Unknown ),
maPageSize(), maPageSize(),
mad3dpp(), mad3dpp(),
maNumVertices( VERTEX_BUFFER_SIZE ), maNumVertices( VERTEX_BUFFER_SIZE ),
@@ -1038,8 +1038,8 @@ namespace dxcanvas
return; return;
--mnBeginSceneCount; --mnBeginSceneCount;
meType=PRIMITIVE_TYPE_UNKNOWN; meType = PrimitiveType::Unknown;
mnCount=0; mnCount = 0;
} }
@@ -1056,7 +1056,7 @@ namespace dxcanvas
switch(meType) switch(meType)
{ {
case PRIMITIVE_TYPE_TRIANGLE: case PrimitiveType::Triangle:
{ {
maVertexCache.push_back(vertex); maVertexCache.push_back(vertex);
++mnCount; ++mnCount;
@@ -1064,7 +1064,7 @@ namespace dxcanvas
break; break;
} }
case PRIMITIVE_TYPE_QUAD: case PrimitiveType::Quad:
{ {
if(mnCount == 3) if(mnCount == 3)
{ {

View File

@@ -158,7 +158,7 @@ namespace canvas
vertex.z = 0.0f; vertex.z = 0.0f;
{ {
pRenderModule->beginPrimitive( canvas::IRenderModule::PRIMITIVE_TYPE_QUAD ); pRenderModule->beginPrimitive( canvas::IRenderModule::PrimitiveType::Quad );
// issue an endPrimitive() when leaving the scope // issue an endPrimitive() when leaving the scope
const ::comphelper::ScopeGuard aScopeGuard( const ::comphelper::ScopeGuard aScopeGuard(
@@ -279,7 +279,7 @@ namespace canvas
vertex.z = 0.0f; vertex.z = 0.0f;
{ {
pRenderModule->beginPrimitive( canvas::IRenderModule::PRIMITIVE_TYPE_QUAD ); pRenderModule->beginPrimitive( canvas::IRenderModule::PrimitiveType::Quad );
// issue an endPrimitive() when leaving the scope // issue an endPrimitive() when leaving the scope
const ::comphelper::ScopeGuard aScopeGuard( const ::comphelper::ScopeGuard aScopeGuard(
@@ -385,7 +385,7 @@ namespace canvas
nVertexCount/3 ); nVertexCount/3 );
#endif #endif
pRenderModule->beginPrimitive( canvas::IRenderModule::PRIMITIVE_TYPE_TRIANGLE ); pRenderModule->beginPrimitive( canvas::IRenderModule::PrimitiveType::Triangle );
// issue an endPrimitive() when leaving the scope // issue an endPrimitive() when leaving the scope
const ::comphelper::ScopeGuard aScopeGuard( const ::comphelper::ScopeGuard aScopeGuard(

View File

@@ -54,11 +54,11 @@ namespace canvas
/** Type of primitive passed to the render module via /** Type of primitive passed to the render module via
pushVertex() pushVertex()
*/ */
enum PrimitiveType enum class PrimitiveType
{ {
PRIMITIVE_TYPE_UNKNOWN, Unknown,
PRIMITIVE_TYPE_TRIANGLE, Triangle,
PRIMITIVE_TYPE_QUAD Quad
}; };
virtual ~IRenderModule() {} virtual ~IRenderModule() {}