diff options
author | Derek Sollenberger <djsollen@google.com> | 2016-10-25 12:09:18 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2016-10-26 12:46:57 +0000 |
commit | daf7229047c44947b9b02ee187fe5b13f30ebd4b (patch) | |
tree | 886071f35e43c59a488073d0e039b10bc7585c85 /libs/hwui/renderthread/OpenGLPipeline.cpp | |
parent | be9a73063c9e2dc56ee1e29cc93308d17b18eece (diff) |
Move OpenGL specific details behind renderPipeline interface.
Test: new and existing unit tests still pass.
Change-Id: I6164f30f45ebe450788ed8d949eca5af9a44e585
Diffstat (limited to 'libs/hwui/renderthread/OpenGLPipeline.cpp')
-rw-r--r-- | libs/hwui/renderthread/OpenGLPipeline.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/OpenGLPipeline.cpp b/libs/hwui/renderthread/OpenGLPipeline.cpp index 1ad38031c487..cca0fca41817 100644 --- a/libs/hwui/renderthread/OpenGLPipeline.cpp +++ b/libs/hwui/renderthread/OpenGLPipeline.cpp @@ -165,6 +165,10 @@ bool OpenGLPipeline::isContextReady() { } void OpenGLPipeline::onDestroyHardwareResources() { + Caches& caches = Caches::getInstance(); + // Make sure to release all the textures we were owning as there won't + // be another draw + caches.textureCache.resetMarkInUse(this); mRenderThread.renderState().flush(Caches::FlushMode::Layers); } @@ -225,6 +229,21 @@ void OpenGLPipeline::destroyLayer(RenderNode* node) { } } +void OpenGLPipeline::prepareToDraw(const RenderThread& thread, Bitmap* bitmap) { + if (Caches::hasInstance() && thread.eglManager().hasEglContext()) { + ATRACE_NAME("Bitmap#prepareToDraw task"); + Caches::getInstance().textureCache.prefetch(bitmap); + } +} + +void OpenGLPipeline::invokeFunctor(const RenderThread& thread, Functor* functor) { + DrawGlInfo::Mode mode = DrawGlInfo::kModeProcessNoContext; + if (thread.eglManager().hasEglContext()) { + mode = DrawGlInfo::kModeProcess; + } + thread.renderState().invokeFunctor(functor, mode, nullptr); +} + } /* namespace renderthread */ } /* namespace uirenderer */ } /* namespace android */ |