Commit 7b7eb8b4 authored by dnicoara's avatar dnicoara Committed by Commit bot

[Ozone-Demo] Update Surfaceless renderer

Fixes the surfaceless renderer since it now has a specfic API for the
creation of the GLSurface.

BUG=none
TEST=Run ./ozone_demo --ozone-platform=gbm --ozone-use-surfaceless

Review URL: https://codereview.chromium.org/975733004

Cr-Commit-Position: refs/heads/master@{#318956}
parent 1908eba9
...@@ -18,7 +18,7 @@ GlRenderer::~GlRenderer() { ...@@ -18,7 +18,7 @@ GlRenderer::~GlRenderer() {
} }
bool GlRenderer::Initialize() { bool GlRenderer::Initialize() {
surface_ = gfx::GLSurface::CreateViewGLSurface(widget_); surface_ = CreateSurface();
if (!surface_.get()) { if (!surface_.get()) {
LOG(ERROR) << "Failed to create GL surface"; LOG(ERROR) << "Failed to create GL surface";
return false; return false;
...@@ -54,4 +54,8 @@ void GlRenderer::RenderFrame() { ...@@ -54,4 +54,8 @@ void GlRenderer::RenderFrame() {
LOG(FATAL) << "Failed to swap buffers"; LOG(FATAL) << "Failed to swap buffers";
} }
scoped_refptr<gfx::GLSurface> GlRenderer::CreateSurface() {
return gfx::GLSurface::CreateViewGLSurface(widget_);
}
} // namespace ui } // namespace ui
...@@ -26,6 +26,8 @@ class GlRenderer : public RendererBase { ...@@ -26,6 +26,8 @@ class GlRenderer : public RendererBase {
void RenderFrame() override; void RenderFrame() override;
protected: protected:
virtual scoped_refptr<gfx::GLSurface> CreateSurface();
scoped_refptr<gfx::GLSurface> surface_; scoped_refptr<gfx::GLSurface> surface_;
scoped_refptr<gfx::GLContext> context_; scoped_refptr<gfx::GLContext> context_;
......
...@@ -133,4 +133,8 @@ void SurfacelessGlRenderer::OnSwapBuffersAck() { ...@@ -133,4 +133,8 @@ void SurfacelessGlRenderer::OnSwapBuffersAck() {
back_buffer_ ^= 1; back_buffer_ ^= 1;
} }
scoped_refptr<gfx::GLSurface> SurfacelessGlRenderer::CreateSurface() {
return gfx::GLSurface::CreateSurfacelessViewGLSurface(widget_);
}
} // namespace ui } // namespace ui
...@@ -32,6 +32,9 @@ class SurfacelessGlRenderer : public GlRenderer { ...@@ -32,6 +32,9 @@ class SurfacelessGlRenderer : public GlRenderer {
// Called by swap buffers when the actual swap finished. // Called by swap buffers when the actual swap finished.
void OnSwapBuffersAck(); void OnSwapBuffersAck();
// GlRenderer:
scoped_refptr<gfx::GLSurface> CreateSurface() override;
class BufferWrapper { class BufferWrapper {
public: public:
BufferWrapper(); BufferWrapper();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment