diff options
author | sergeyv <sergeyv@google.com> | 2016-10-20 18:39:04 -0700 |
---|---|---|
committer | sergeyv <sergeyv@google.com> | 2016-10-21 12:11:44 -0700 |
commit | ec4a4b13eae2241d1613890c1c1c096bed891845 (patch) | |
tree | 8a59769cc8bff549e8ec0bbd048912e91f218ab6 /libs/hwui/renderthread/RenderProxy.cpp | |
parent | 5fd2a1cb2726afa7d40fe4750e9defd89c24ed37 (diff) |
Use Bitmap in DisplayList & RecordedOps instead of SkBitmap
Test: refactoring cl.
bug:32216791
Change-Id: I1d8a9a6e772e2176b6c2409409a910478b45f8db
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index c2ed8643c0ad..42da293021b9 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -617,17 +617,17 @@ int RenderProxy::copySurfaceInto(sp<Surface>& surface, int left, int top, reinterpret_cast<intptr_t>( staticPostAndWait(task) )); } -CREATE_BRIDGE2(prepareToDraw, RenderThread* thread, SkBitmap* bitmap) { +CREATE_BRIDGE2(prepareToDraw, RenderThread* thread, Bitmap* bitmap) { if (Caches::hasInstance() && args->thread->eglManager().hasEglContext()) { ATRACE_NAME("Bitmap#prepareToDraw task"); Caches::getInstance().textureCache.prefetch(args->bitmap); } - delete args->bitmap; + args->bitmap->unref(); args->bitmap = nullptr; return nullptr; } -void RenderProxy::prepareToDraw(const SkBitmap& bitmap) { +void RenderProxy::prepareToDraw(Bitmap& bitmap) { // If we haven't spun up a hardware accelerated window yet, there's no // point in precaching these bitmaps as it can't impact jank. // We also don't know if we even will spin up a hardware-accelerated @@ -636,7 +636,8 @@ void RenderProxy::prepareToDraw(const SkBitmap& bitmap) { RenderThread* renderThread = &RenderThread::getInstance(); SETUP_TASK(prepareToDraw); args->thread = renderThread; - args->bitmap = new SkBitmap(bitmap); + bitmap.ref(); + args->bitmap = &bitmap; nsecs_t lastVsync = renderThread->timeLord().latestVsync(); nsecs_t estimatedNextVsync = lastVsync + renderThread->timeLord().frameIntervalNanos(); nsecs_t timeToNextVsync = estimatedNextVsync - systemTime(CLOCK_MONOTONIC); |