RE: Add a test verifying we've compiled a min no of shaders
To prevent regressions, verify that SkiaGLRenderEngine compiles some
number of shaders. This varies per device, so use a lower bound instead
of an exact number. This would have caught the regression referenced in
I9f0e9e8535feee48700f1c896f26833b6095764d, though it could miss a
smaller regression.
Repurpose reportShadersCompiled for this: make it return the total
number of shaders. (With the old behavior, its value is reset when it is
called for the print statement at the end of Cache::primeShaderCache.)
Update its only client to still have the same behavior.
Remove assertShadersCompiled - we decided against that approach in
Ia0c63402e8b2f6ee91f59603951602511bfae853.
Bug: 190487656
Bug: 222355787
Test: this
Change-Id: I3c1108655456fc8aa660ff3f272e0b9b20790c60
diff --git a/libs/renderengine/skia/Cache.cpp b/libs/renderengine/skia/Cache.cpp
index 5c137a4..f3064f3 100644
--- a/libs/renderengine/skia/Cache.cpp
+++ b/libs/renderengine/skia/Cache.cpp
@@ -439,7 +439,7 @@
const nsecs_t timeAfter = systemTime();
const float compileTimeMs = static_cast<float>(timeAfter - timeBefore) / 1.0E6;
- const int shadersCompiled = renderengine->reportShadersCompiled();
+ const int shadersCompiled = renderengine->reportShadersCompiled() - previousCount;
ALOGD("Shader cache generated %d shaders in %f ms\n", shadersCompiled, compileTimeMs);
}
}