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/SkiaGLRenderEngine.h b/libs/renderengine/skia/SkiaGLRenderEngine.h
index a650313..bef2cd0 100644
--- a/libs/renderengine/skia/SkiaGLRenderEngine.h
+++ b/libs/renderengine/skia/SkiaGLRenderEngine.h
@@ -61,7 +61,6 @@
bool supportsProtectedContent() const override;
void useProtectedContext(bool useProtectedContext) override;
bool supportsBackgroundBlur() override { return mBlurFilter != nullptr; }
- void assertShadersCompiled(int numShaders) override;
void onActiveDisplaySizeChanged(ui::Size size) override;
int reportShadersCompiled() override;
@@ -178,6 +177,8 @@
return shadersCachedSinceLastCall;
}
+ int totalShadersCompiled() const { return mTotalShadersCompiled; }
+
private:
int mShadersCachedSinceLastCall = 0;
};