diff options
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index ac19a153b6fb..6fd644bfa28e 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -390,6 +390,17 @@ int RenderProxy::copyHWBitmapInto(Bitmap* hwBitmap, SkBitmap* bitmap) { } } +int RenderProxy::copyImageInto(const sk_sp<SkImage>& image, SkBitmap* bitmap) { + RenderThread& thread = RenderThread::getInstance(); + if (gettid() == thread.getTid()) { + // TODO: fix everything that hits this. We should never be triggering a readback ourselves. + return (int)thread.readback().copyImageInto(image, bitmap); + } else { + return thread.queue().runSync( + [&]() -> int { return (int)thread.readback().copyImageInto(image, bitmap); }); + } +} + void RenderProxy::disableVsync() { Properties::disableVsync = true; } |