Loading libs/hwui/pipeline/skia/SkiaPipeline.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -207,12 +207,16 @@ bool SkiaPipeline::createOrUpdateLayer(RenderNode* node, const DamageAccumulator void SkiaPipeline::prepareToDraw(const RenderThread& thread, Bitmap* bitmap) { GrDirectContext* context = thread.getGrContext(); if (context) { if (context && !bitmap->isHardware()) { ATRACE_FORMAT("Bitmap#prepareToDraw %dx%d", bitmap->width(), bitmap->height()); auto image = bitmap->makeImage(); if (image.get() && !bitmap->isHardware()) { if (image.get()) { SkImage_pinAsTexture(image.get(), context); SkImage_unpinAsTexture(image.get(), context); // A submit is necessary as there may not be a frame coming soon, so without a call // to submit these texture uploads can just sit in the queue building up until // we run out of RAM context->flushAndSubmit(); } } } Loading libs/hwui/renderthread/DrawFrameTask.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,12 @@ void DrawFrameTask::run() { if (CC_LIKELY(canDrawThisFrame)) { dequeueBufferDuration = context->draw(); } else { // Do a flush in case syncFrameState performed any texture uploads. Since we skipped // the draw() call, those uploads (or deletes) will end up sitting in the queue. // Do them now if (GrDirectContext* grContext = mRenderThread->getGrContext()) { grContext->flushAndSubmit(); } // wait on fences so tasks don't overlap next frame context->waitOnFences(); } Loading Loading
libs/hwui/pipeline/skia/SkiaPipeline.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -207,12 +207,16 @@ bool SkiaPipeline::createOrUpdateLayer(RenderNode* node, const DamageAccumulator void SkiaPipeline::prepareToDraw(const RenderThread& thread, Bitmap* bitmap) { GrDirectContext* context = thread.getGrContext(); if (context) { if (context && !bitmap->isHardware()) { ATRACE_FORMAT("Bitmap#prepareToDraw %dx%d", bitmap->width(), bitmap->height()); auto image = bitmap->makeImage(); if (image.get() && !bitmap->isHardware()) { if (image.get()) { SkImage_pinAsTexture(image.get(), context); SkImage_unpinAsTexture(image.get(), context); // A submit is necessary as there may not be a frame coming soon, so without a call // to submit these texture uploads can just sit in the queue building up until // we run out of RAM context->flushAndSubmit(); } } } Loading
libs/hwui/renderthread/DrawFrameTask.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,12 @@ void DrawFrameTask::run() { if (CC_LIKELY(canDrawThisFrame)) { dequeueBufferDuration = context->draw(); } else { // Do a flush in case syncFrameState performed any texture uploads. Since we skipped // the draw() call, those uploads (or deletes) will end up sitting in the queue. // Do them now if (GrDirectContext* grContext = mRenderThread->getGrContext()) { grContext->flushAndSubmit(); } // wait on fences so tasks don't overlap next frame context->waitOnFences(); } Loading