Commit 9a60c144 authored by Brian Ho's avatar Brian Ho Committed by Commit Bot

ozone: Advertise a top-left origin for GbmSurfaceless

Enabling SkiaRenderer on Chrome OS currently fails a DCHECK [1] that
asserts the backing GLSurface has a top-left origin. Since
GetOrigin() returns the OS presentation API's origin, GbmSurfaceless
should also return a top-left origin. For example, if you call
gbm_bo_map with (x = 0, y = 0), the returned data pointer will
correspond to the top-left of the buffer.

[1] https://source.chromium.org/chromium/chromium/src/+/master:components/viz/service/display_embedder/output_presenter_gl.cc;l=223;drc=238120617b24d1856e0d66e2a6d3272a5e94f658

Change-Id: I0cdfa9d3414cb844dc33470c6342a3a944074d09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2511879Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Commit-Queue: Brian Ho <hob@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824399}
parent 8da24db8
......@@ -215,6 +215,10 @@ void GbmSurfaceless::SetForceGlFlushOnSwapBuffers() {
requires_gl_flush_on_swap_buffers_ = true;
}
gfx::SurfaceOrigin GbmSurfaceless::GetOrigin() const {
return gfx::SurfaceOrigin::kTopLeft;
}
GbmSurfaceless::~GbmSurfaceless() {
Destroy(); // The EGL surface must be destroyed before SurfaceOzone.
surface_factory_->UnregisterSurface(window_->widget());
......
......@@ -72,6 +72,7 @@ class GbmSurfaceless : public gl::SurfacelessEGL {
EGLConfig GetConfig() override;
void SetRelyOnImplicitSync() override;
void SetForceGlFlushOnSwapBuffers() override;
gfx::SurfaceOrigin GetOrigin() const override;
protected:
~GbmSurfaceless() override;
......
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