Merge "Fix ANR & Crash on Ryu" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6890dc95d0
@@ -877,7 +877,8 @@ static jobject android_view_ThreadedRenderer_createHardwareBitmapFromRenderNode(
|
|||||||
sp<IGraphicBufferProducer> producer;
|
sp<IGraphicBufferProducer> producer;
|
||||||
sp<IGraphicBufferConsumer> rawConsumer;
|
sp<IGraphicBufferConsumer> rawConsumer;
|
||||||
BufferQueue::createBufferQueue(&producer, &rawConsumer);
|
BufferQueue::createBufferQueue(&producer, &rawConsumer);
|
||||||
rawConsumer->setMaxBufferCount(1);
|
// We only need 1 buffer but some drivers have bugs so workaround it by setting max count to 2
|
||||||
|
rawConsumer->setMaxBufferCount(2);
|
||||||
sp<BufferItemConsumer> consumer = new BufferItemConsumer(rawConsumer,
|
sp<BufferItemConsumer> consumer = new BufferItemConsumer(rawConsumer,
|
||||||
GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_NEVER);
|
GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_NEVER);
|
||||||
consumer->setDefaultBufferSize(width, height);
|
consumer->setDefaultBufferSize(width, height);
|
||||||
|
|||||||
@@ -437,8 +437,8 @@ void CanvasContext::draw() {
|
|||||||
if (mNativeSurface.get()) {
|
if (mNativeSurface.get()) {
|
||||||
int durationUs;
|
int durationUs;
|
||||||
nsecs_t dequeueStart = mNativeSurface->getLastDequeueStartTime();
|
nsecs_t dequeueStart = mNativeSurface->getLastDequeueStartTime();
|
||||||
if (dequeueStart < mCurrentFrameInfo->get(FrameInfoIndex::Vsync)) {
|
if (dequeueStart < mCurrentFrameInfo->get(FrameInfoIndex::SyncStart)) {
|
||||||
// Ignoring dequeue duration as it happened prior to vsync
|
// Ignoring dequeue duration as it happened prior to frame render start
|
||||||
// and thus is not part of the frame.
|
// and thus is not part of the frame.
|
||||||
swap.dequeueDuration = 0;
|
swap.dequeueDuration = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user