summaryrefslogtreecommitdiff
path: root/libs/hwui/renderstate/RenderState.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2017-07-17 09:55:02 -0700
committerJohn Reck <jreck@google.com>2017-08-10 17:22:43 +0000
commit642ebea6e14b72c512ef1168dc6edb061035dded (patch)
treed2b562aefd9d4804a936f442422e6576c387f150 /libs/hwui/renderstate/RenderState.cpp
parent15ea142044cd5212ed6fe86987297a64f0d7a4fb (diff)
Delete all ro.hwui.* props
Remove all ro.hwui.* tuning props and instead calculate them from the screen resolution. Or just hardcode them to what all devices were hardcoding them to anyway. Bug: 63741221 Test: Check cache size results on sailfish Change-Id: I8b0d210572a246f4fefb076935cf5156a70c274c Merged-In: I8b0d210572a246f4fefb076935cf5156a70c274c (cherry picked from commit 8dc02f99d09130ace2ee738c2e689db1b3f33181)
Diffstat (limited to 'libs/hwui/renderstate/RenderState.cpp')
-rw-r--r--libs/hwui/renderstate/RenderState.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/hwui/renderstate/RenderState.cpp b/libs/hwui/renderstate/RenderState.cpp
index 2c92924cc12c..ededffb0f4bb 100644
--- a/libs/hwui/renderstate/RenderState.cpp
+++ b/libs/hwui/renderstate/RenderState.cpp
@@ -53,6 +53,11 @@ void RenderState::onGLContextCreated() {
mScissor = new Scissor();
mStencil = new Stencil();
+ // Deferred because creation needs GL context for texture limits
+ if (!mLayerPool) {
+ mLayerPool = new OffscreenBufferPool();
+ }
+
// This is delayed because the first access of Caches makes GL calls
if (!mCaches) {
mCaches = &Caches::createInstance(*this);
@@ -67,7 +72,7 @@ static void layerLostGlContext(Layer* layer) {
}
void RenderState::onGLContextDestroyed() {
- mLayerPool.clear();
+ mLayerPool->clear();
// TODO: reset all cached state in state objects
std::for_each(mActiveLayers.begin(), mActiveLayers.end(), layerLostGlContext);
@@ -100,7 +105,7 @@ static void layerDestroyedVkContext(Layer* layer) {
}
void RenderState::onVkContextDestroyed() {
- mLayerPool.clear();
+ mLayerPool->clear();
std::for_each(mActiveLayers.begin(), mActiveLayers.end(), layerDestroyedVkContext);
GpuMemoryTracker::onGpuContextDestroyed();
}
@@ -116,10 +121,10 @@ void RenderState::flush(Caches::FlushMode mode) {
case Caches::FlushMode::Moderate:
// fall through
case Caches::FlushMode::Layers:
- mLayerPool.clear();
+ if (mLayerPool) mLayerPool->clear();
break;
}
- mCaches->flush(mode);
+ if (mCaches) mCaches->flush(mode);
}
void RenderState::onBitmapDestroyed(uint32_t pixelRefId) {