Code example for Transformation

Methods: assertNotEqual, getAlpha, getMatrix

0
        assertEquals(glRootView.pushTransform(), glRootView.getTransformation());
        glRootView.popTransform();
        Transformation t1= glRootView.getTransformation();
        Transformation t2 = glRootView.obtainTransformation();
        Matrix f1 = t1.getMatrix();
        Matrix f2 = t2.getMatrix();
        float a1 = t1.getAlpha();
        float a2 = t2.getAlpha();
        assertEquals(f1, f2);
        assertEquals(a1, a2);
        assertNotEqual(t1, t2);
    } 
 
    public void testDpToPixel() { 
        GLRootView glRootView = new GLRootView(mActivity);
         DisplayMetrics metrics = new DisplayMetrics();
            mActivity.getWindowManager()
            .getDefaultDisplay().getMetrics(metrics);
        float f = metrics.density;
 
        f = f*2f+0.5f;