Merge "Fix for Surface#lockHardwareCanvas lockups" into qt-qpr1-dev
This commit is contained in:
@@ -488,7 +488,7 @@ static jlong create(JNIEnv* env, jclass clazz, jlong rootNodePtr, jlong surfaceP
|
|||||||
proxy->setWideGamut(true);
|
proxy->setWideGamut(true);
|
||||||
}
|
}
|
||||||
proxy->setSwapBehavior(SwapBehavior::kSwap_discardBuffer);
|
proxy->setSwapBehavior(SwapBehavior::kSwap_discardBuffer);
|
||||||
proxy->setSurface(surface);
|
proxy->setSurface(surface, false);
|
||||||
// Shadows can't be used via this interface, so just set the light source
|
// Shadows can't be used via this interface, so just set the light source
|
||||||
// to all 0s.
|
// to all 0s.
|
||||||
proxy->setLightAlpha(0, 0);
|
proxy->setLightAlpha(0, 0);
|
||||||
|
|||||||
@@ -143,13 +143,15 @@ void CanvasContext::destroy() {
|
|||||||
mAnimationContext->destroy();
|
mAnimationContext->destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CanvasContext::setSurface(sp<Surface>&& surface) {
|
void CanvasContext::setSurface(sp<Surface>&& surface, bool enableTimeout) {
|
||||||
ATRACE_CALL();
|
ATRACE_CALL();
|
||||||
|
|
||||||
if (surface) {
|
if (surface) {
|
||||||
mNativeSurface = new ReliableSurface{std::move(surface)};
|
mNativeSurface = new ReliableSurface{std::move(surface)};
|
||||||
// TODO: Fix error handling & re-shorten timeout
|
if (enableTimeout) {
|
||||||
mNativeSurface->setDequeueTimeout(4000_ms);
|
// TODO: Fix error handling & re-shorten timeout
|
||||||
|
mNativeSurface->setDequeueTimeout(4000_ms);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mNativeSurface = nullptr;
|
mNativeSurface = nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public:
|
|||||||
// Won't take effect until next EGLSurface creation
|
// Won't take effect until next EGLSurface creation
|
||||||
void setSwapBehavior(SwapBehavior swapBehavior);
|
void setSwapBehavior(SwapBehavior swapBehavior);
|
||||||
|
|
||||||
void setSurface(sp<Surface>&& surface);
|
void setSurface(sp<Surface>&& surface, bool enableTimeout = true);
|
||||||
bool pauseSurface();
|
bool pauseSurface();
|
||||||
void setStopped(bool stopped);
|
void setStopped(bool stopped);
|
||||||
bool hasSurface() const { return mNativeSurface.get(); }
|
bool hasSurface() const { return mNativeSurface.get(); }
|
||||||
|
|||||||
@@ -82,9 +82,10 @@ void RenderProxy::setName(const char* name) {
|
|||||||
mRenderThread.queue().runSync([this, name]() { mContext->setName(std::string(name)); });
|
mRenderThread.queue().runSync([this, name]() { mContext->setName(std::string(name)); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderProxy::setSurface(const sp<Surface>& surface) {
|
void RenderProxy::setSurface(const sp<Surface>& surface, bool enableTimeout) {
|
||||||
mRenderThread.queue().post(
|
mRenderThread.queue().post([this, surf = surface, enableTimeout]() mutable {
|
||||||
[this, surf = surface]() mutable { mContext->setSurface(std::move(surf)); });
|
mContext->setSurface(std::move(surf), enableTimeout);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderProxy::allocateBuffers() {
|
void RenderProxy::allocateBuffers() {
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
ANDROID_API bool loadSystemProperties();
|
ANDROID_API bool loadSystemProperties();
|
||||||
ANDROID_API void setName(const char* name);
|
ANDROID_API void setName(const char* name);
|
||||||
|
|
||||||
ANDROID_API void setSurface(const sp<Surface>& surface);
|
ANDROID_API void setSurface(const sp<Surface>& surface, bool enableTimeout = true);
|
||||||
ANDROID_API void allocateBuffers();
|
ANDROID_API void allocateBuffers();
|
||||||
ANDROID_API bool pause();
|
ANDROID_API bool pause();
|
||||||
ANDROID_API void setStopped(bool stopped);
|
ANDROID_API void setStopped(bool stopped);
|
||||||
|
|||||||
Reference in New Issue
Block a user