Commit 3e658b23 authored by dnicoara's avatar dnicoara Committed by Commit bot

[Ozone-Gbm] Explicitly crash if trying software rendering on GBM

Software rendering isn't supported on the GBM platform. Rather than
allow callers to crash due to nullptr accesses, crash explicitly so we
get more meaningfull crash reports.

BUG=461396

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

Cr-Commit-Position: refs/heads/master@{#318728}
parent 4a7ba126
......@@ -21,6 +21,7 @@
#include "ui/ozone/public/native_pixmap.h"
#include "ui/ozone/public/overlay_candidates_ozone.h"
#include "ui/ozone/public/ozone_switches.h"
#include "ui/ozone/public/surface_ozone_canvas.h"
#include "ui/ozone/public/surface_ozone_egl.h"
namespace ui {
......@@ -119,6 +120,12 @@ bool GbmSurfaceFactory::LoadEGLGLES2Bindings(
return LoadDefaultEGLGLES2Bindings(add_gl_library, set_gl_get_proc_address);
}
scoped_ptr<SurfaceOzoneCanvas> GbmSurfaceFactory::CreateCanvasForWidget(
gfx::AcceleratedWidget widget) {
LOG(FATAL) << "Software rendering mode is not supported with GBM platform";
return nullptr;
}
scoped_ptr<SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget(
gfx::AcceleratedWidget widget) {
scoped_refptr<GbmWrapper> gbm = GetGbmDevice(widget);
......
......@@ -29,6 +29,8 @@ class GbmSurfaceFactory : public DriSurfaceFactory {
bool LoadEGLGLES2Bindings(
AddGLLibraryCallback add_gl_library,
SetGLGetProcAddressProcCallback set_gl_get_proc_address) override;
scoped_ptr<SurfaceOzoneCanvas> CreateCanvasForWidget(
gfx::AcceleratedWidget widget) override;
scoped_ptr<ui::SurfaceOzoneEGL> CreateEGLSurfaceForWidget(
gfx::AcceleratedWidget w) override;
scoped_ptr<SurfaceOzoneEGL> CreateSurfacelessEGLSurfaceForWidget(
......
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