void CEglTest_TestStep_StressLoad::LoadGpuProcessorL()
    {
    CSurface  *surface = CSurface::SurfaceFactoryL(ESurfTypeEglWindow);
    CleanupStack::PushL(surface);
    surface->CreateL(EStandard128sqSurface, TPoint(128, 128));
    TRgb bg = TRgb(0x55, 0x88, 0xff);   // Cyan/turqoise-ish.  
    TRgb fg = TRgb(0xff, 0x11, 0x22);   // Red (sort of)
    while(!__e32_atomic_load_acq32(&iStopThreadFlag[EThreadLoadGpuProcessor])) 
        {
            surface->DrawContentL(bg);
            surface->DrawComplexL(fg);
            surface->SubmitContent(ETrue);
        }
    CleanupStack::PopAndDestroy(surface);
    eglReleaseThread();
    }
void CEglTest_TestStep_StressLoad::LoadGpuMemoryL()
    {
    const TInt KMaxSurfaceAllocs = 1000;
    CSurface **surfaces = new CSurface*[KMaxSurfaceAllocs];
    ENGINE_ASSERT(surfaces);
    TInt nSurfaces = 0;
    TInt err;
    while(!__e32_atomic_load_acq32(&iStopThreadFlag[EThreadLoadGpuMemory]))     
        {
        ENGINE_ASSERT(nSurfaces < KMaxSurfaceAllocs);
        CSurface* s = CSurface::SurfaceFactoryL(ESurfTypePBuffer);
        if (s)
            {
            TRAP(err, s->CreateL(ELargeSurface));
            if (err == KErrNone)
                {
                surfaces[nSurfaces++] = s;
                TRAP(err, s->DrawContentL(TRgb(0x10, 0x20, 0xB0)));
                }
            else
                {
                delete s;
                s = NULL;
                }
            }
        if (!s)
            {
            User::After(100 * 1000);
            TInt nRelease = nSurfaces / 4;
            for(TInt i = 0; i < nRelease; i++)
                {
                delete surfaces[--nSurfaces];
                surfaces[nSurfaces] = NULL;
                }
            User::After(100 * 1000); // 100 ms. 
            }
        }
    while(nSurfaces)
        {
        delete surfaces[--nSurfaces];
        }
    delete [] surfaces;
    eglReleaseThread();
    }