inline void Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
{
+ mScissorParams.x = x;
+ mScissorParams.y = y;
+ mScissorParams.width = width;
+ mScissorParams.height = height;
}
inline void ShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
ATTRIB_TYPE_LAST
};
+ struct ScissorParams
+ {
+ GLint x;
+ GLint y;
+ GLsizei width;
+ GLsizei height;
+
+ ScissorParams() : x( 0 ), y( 0 ), width( 0 ), height( 0 ) { }
+ };
+
+ // Methods to check scissor tests
+ inline const ScissorParams& GetScissorParams() const { return mScissorParams; }
private:
GLuint mCurrentProgram;
mVertexAttribArrayState[ index ] = state;
mVertexAttribArrayChanged = true;
}
+
+ ScissorParams mScissorParams;
};
template <>
DALI_TEST_EQUALS( layer.IsTouchConsumed(), true, TEST_LOCATION );
END_TEST;
}
+
+int UtcDaliLayerClippingGLCalls(void)
+{
+ TestApplication application;
+ const TestGlAbstraction::ScissorParams& glScissorParams( application.GetGlAbstraction().GetScissorParams() );
+ Stage stage( Stage::GetCurrent() );
+
+ ClippingBox testBox( 5, 6, 77, 83 );
+ Layer layer = Stage::GetCurrent().GetRootLayer();
+ layer.SetClipping( true );
+ layer.SetClippingBox( testBox );
+
+ // Add at least one renderable actor so the GL calls are actually made
+ Actor textActor = TextActor::New("Hello");
+ stage.Add( textActor );
+
+ // flush the queue and render once
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( testBox.x, glScissorParams.x, TEST_LOCATION );
+ DALI_TEST_EQUALS( testBox.y, stage.GetSize().height - glScissorParams.y - testBox.height, TEST_LOCATION ); // GL Coordinates are from bottom left
+ DALI_TEST_EQUALS( testBox.width, glScissorParams.width, TEST_LOCATION );
+ DALI_TEST_EQUALS( testBox.height, glScissorParams.height, TEST_LOCATION );
+
+ END_TEST;
+}