Enable SkiaPipelines to interoperate with existing GlesDriver configs.
Test: hwui unit tests Change-Id: Icd94d0e21130d86fb5514801f999d0018a69e151
This commit is contained in:
@@ -36,6 +36,11 @@ std::unique_ptr<GlesDriver> GlesDriver::replace(std::unique_ptr<GlesDriver>&& dr
|
||||
return ret;
|
||||
}
|
||||
|
||||
sk_sp<const GrGLInterface> GlesDriver::getSkiaInterface() {
|
||||
sk_sp<const GrGLInterface> skiaInterface(GrGLCreateNativeInterface());
|
||||
return skiaInterface;
|
||||
}
|
||||
|
||||
} // namespace debug
|
||||
} // namespace uirenderer
|
||||
} // namespace android
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <GLES3/gl31.h>
|
||||
#include <GLES3/gl32.h>
|
||||
|
||||
#include <gl/GrGLInterface.h>
|
||||
#include <memory>
|
||||
|
||||
namespace android {
|
||||
@@ -39,6 +40,7 @@ namespace debug {
|
||||
class GlesDriver {
|
||||
public:
|
||||
virtual ~GlesDriver() {}
|
||||
virtual sk_sp<const GrGLInterface> getSkiaInterface();
|
||||
|
||||
#define GL_ENTRY(ret, api, ...) virtual ret api##_(__VA_ARGS__) = 0;
|
||||
#include "gles_decls.in"
|
||||
|
||||
@@ -20,6 +20,11 @@ namespace android {
|
||||
namespace uirenderer {
|
||||
namespace debug {
|
||||
|
||||
sk_sp<const GrGLInterface> NullGlesDriver::getSkiaInterface() {
|
||||
sk_sp<const GrGLInterface> skiaInterface(GrGLCreateNullInterface());
|
||||
return skiaInterface;
|
||||
}
|
||||
|
||||
struct {
|
||||
GLboolean scissorEnabled;
|
||||
} gState;
|
||||
|
||||
@@ -24,6 +24,8 @@ namespace debug {
|
||||
|
||||
class NullGlesDriver : public FatalBaseDriver {
|
||||
public:
|
||||
virtual sk_sp<const GrGLInterface> getSkiaInterface() override;
|
||||
|
||||
virtual void glGenBuffers_(GLsizei n, GLuint *buffers) override;
|
||||
virtual void glGenFramebuffers_(GLsizei n, GLuint *framebuffers) override;
|
||||
virtual void glGenRenderbuffers_(GLsizei n, GLuint *renderbuffers) override;
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
#include <gl/GrGLInterface.h>
|
||||
#include <string>
|
||||
|
||||
#ifdef HWUI_GLES_WRAP_ENABLED
|
||||
#include "debug/GlesDriver.h"
|
||||
#endif
|
||||
|
||||
#define GLES_VERSION 2
|
||||
|
||||
// Android-specific addition that is used to show when frames began in systrace
|
||||
@@ -131,7 +135,12 @@ void EglManager::initialize() {
|
||||
mRenderThread.renderState().onGLContextCreated();
|
||||
|
||||
if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaGL) {
|
||||
#ifdef HWUI_GLES_WRAP_ENABLED
|
||||
debug::GlesDriver* driver = debug::GlesDriver::get();
|
||||
sk_sp<const GrGLInterface> glInterface(driver->getSkiaInterface());
|
||||
#else
|
||||
sk_sp<const GrGLInterface> glInterface(GrGLCreateNativeInterface());
|
||||
#endif
|
||||
LOG_ALWAYS_FATAL_IF(!glInterface.get());
|
||||
|
||||
GrContextOptions options;
|
||||
|
||||
Reference in New Issue
Block a user