#define __DALI_INTERNAL_CONTEXT_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
#include <dali/integration-api/debug.h>
#include <dali/integration-api/gl-abstraction.h>
#include <dali/integration-api/gl-defines.h>
-#include <dali/devel-api/rendering/material.h>
+#include <dali/devel-api/rendering/renderer.h>
#include <dali/internal/render/common/performance-monitor.h>
#include <dali/internal/render/gl-resources/texture-units.h>
#include <dali/internal/render/gl-resources/frame-buffer-state-cache.h>
* enables GL_CULL_FACE if in any of the face culling modes
* otherwise disables GL_CULL_FACE
*/
- void CullFace( Dali::Material::FaceCullingMode mode )
+ void CullFace( Dali::FaceCullingMode::Type mode )
{
// Avoid unnecessary calls to gl
if(mCullFaceMode != mode)
mCullFaceMode = mode;
switch(mode)
{
- case Dali::Material::NONE:
+ case Dali::FaceCullingMode::NONE:
{
LOG_GL("Disable GL_CULL_FACE\n");
CHECK_GL( mGlAbstraction, mGlAbstraction.Disable(GL_CULL_FACE) );
break;
}
- case Dali::Material::CULL_FRONT:
+ case Dali::FaceCullingMode::FRONT:
{
LOG_GL("Enable GL_CULL_FACE\n");
CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE) );
break;
}
- case Dali::Material::CULL_BACK:
+ case Dali::FaceCullingMode::BACK:
{
LOG_GL("Enable GL_CULL_FACE\n");
CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE) );
break;
}
- case Dali::Material::CULL_BACK_AND_FRONT:
+ case Dali::FaceCullingMode::FRONT_AND_BACK:
{
LOG_GL("Enable GL_CULL_FACE\n");
CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE) );
*/
const Rect< int >& GetViewport();
- /**
- * Set the frame count of render thread
- */
- inline void SetFrameCount(unsigned int frameCount)
- {
- mFrameCount = frameCount;
- }
-
- /**
- * Get the frame count
- */
- inline unsigned int GetFrameCount()
- {
- return mFrameCount;
- }
-
- /**
- * Increment the count of culled renderers
- */
- inline void IncrementCulledCount()
- {
- mCulledCount++;
- }
-
- /**
- * Clear the count of culled renderers
- */
- inline void ClearCulledCount()
- {
- mCulledCount = 0;
- }
-
- /**
- * Get the count of culled renderers in this frame
- */
- inline unsigned int GetCulledCount()
- {
- return mCulledCount;
- }
-
- /**
- * Increment the count of culled renderers
- */
- inline void IncrementRendererCount()
- {
- mRendererCount++;
- }
-
- /**
- * Clear the count of image renderers
- */
- inline void ClearRendererCount()
- {
- mRendererCount = 0;
- }
-
- /**
- * Get the count of image renderers in this frame
- */
- inline unsigned int GetRendererCount()
- {
- return mRendererCount;
- }
-
private: // Implementation
/**
void FlushVertexAttributeLocations();
/**
- * Reset the cached internal vertex attribute state
- */
- void ResetVertexAttributeState();
-
- /**
* Either enables or disables a vertex attribute location in the cache
* The cahnges won't take affect until FlushVertexAttributeLocations is called
* @param location attribute location
/**
* Sets the initial GL state.
*/
- void ResetGlState();
+ void InitializeGlState();
private: // Data
Vector4 mClearColor; ///< clear color
// Face culling mode
- Dali::Material::FaceCullingMode mCullFaceMode;
+ Dali::FaceCullingMode::Type mCullFaceMode;
// cached viewport size
Rect< int > mViewPort;
bool mVertexAttributeCachedState[ MAX_ATTRIBUTE_CACHE_SIZE ]; ///< Value cache for Enable Vertex Attribute
bool mVertexAttributeCurrentState[ MAX_ATTRIBUTE_CACHE_SIZE ]; ///< Current state on the driver for Enable Vertex Attribute
- unsigned int mFrameCount; ///< Number of render frames
- unsigned int mCulledCount; ///< Number of culled renderers per frame
- unsigned int mRendererCount; ///< Number of image renderers per frame
FrameBufferStateCache mFrameBufferStateCache; ///< frame buffer state cache
};