summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderThread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 0268bfd73e55..4ba774801bba 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -16,6 +16,7 @@
#include "RenderThread.h"
+#include <gui/TraceUtils.h>
#include "../HardwareBitmapUploader.h"
#include "CanvasContext.h"
#include "DeviceInfo.h"
@@ -29,7 +30,6 @@
#include "pipeline/skia/SkiaVulkanPipeline.h"
#include "renderstate/RenderState.h"
#include "utils/TimeUtils.h"
-#include "utils/TraceUtils.h"
#include <GrContextOptions.h>
#include <gl/GrGLInterface.h>
@@ -347,6 +347,15 @@ void RenderThread::setGrContext(sk_sp<GrDirectContext> context) {
}
}
+sk_sp<GrDirectContext> RenderThread::requireGrContext() {
+ if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaGL) {
+ requireGlContext();
+ } else {
+ requireVkContext();
+ }
+ return mGrContext;
+}
+
int RenderThread::choreographerCallback(int fd, int events, void* data) {
if (events & (Looper::EVENT_ERROR | Looper::EVENT_HANGUP)) {
ALOGE("Display event receiver pipe was closed or an error occurred. "