Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Unified Diff: ui/gl/gl_surface_ozone.cc

Issue 1309273005: native_viewport support for ozone (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: addressing review feedback Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gl/gl_surface_ozone.cc
diff --git a/ui/gl/gl_surface_ozone.cc b/ui/gl/gl_surface_ozone.cc
index c513e5fb88d1538bb985a1cff9728ce5dbd6d9d2..2b3ed42270516e1c0b64e2a0a47ea525a4d0a645 100644
--- a/ui/gl/gl_surface_ozone.cc
+++ b/ui/gl/gl_surface_ozone.cc
@@ -251,7 +251,8 @@ GLSurfaceOzoneSurfaceless::GLSurfaceOzoneSurfaceless(
scoped_ptr<ui::SurfaceOzoneEGL> ozone_surface,
AcceleratedWidget widget,
const gfx::SurfaceConfiguration& requested_configuration)
- : SurfacelessEGL(gfx::Size(), requested_configuration),
+ : SurfacelessEGL(gfx::Size(1, 1), // passing zero size causes a failure
+ requested_configuration),
ozone_surface_(ozone_surface.Pass()),
widget_(widget),
has_implicit_external_sync_(
@@ -433,6 +434,7 @@ class GL_EXPORT GLSurfaceOzoneSurfacelessSurfaceImpl
gfx::SwapResult SwapBuffers() override;
bool SwapBuffersAsync(const SwapCompletionCallback& callback) override;
void Destroy() override;
+ bool IsSurfaceless() const override { return false; }
private:
class SurfaceImage : public GLImageLinuxDMABuffer {
@@ -606,9 +608,12 @@ bool GLSurfaceOzoneSurfacelessSurfaceImpl::CreatePixmaps() {
new SurfaceImage(GetSize(), GL_BGRA_EXT);
if (!image->Initialize(pixmap, gfx::GpuMemoryBuffer::Format::BGRA_8888))
return false;
+ if (images_[i])
+ images_[i]->Destroy(true);
images_[i] = image;
// Bind image to texture.
ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]);
+
if (!images_[i]->BindTexImage(GL_TEXTURE_2D))
return false;
}

Powered by Google App Engine
This is Rietveld 408576698