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

Unified Diff: ui/gl/gl_surface_ozone.cc

Issue 1258713002: ozone: unify GpuMemoryBufferFactoryOzoneNativePixmap in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix linux_chromium_gn_dgb build Created 5 years, 5 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
« no previous file with comments | « ui/gl/gl_image_ozone_native_pixmap.cc ('k') | ui/ozone/demo/ozone_demo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_ozone.cc
diff --git a/ui/gl/gl_surface_ozone.cc b/ui/gl/gl_surface_ozone.cc
index 50a7326f66fb9acdd769248ceeb1ad1fc6748ec6..a0167510f6fb78a98c46334e02ec8448a2fbcffd 100644
--- a/ui/gl/gl_surface_ozone.cc
+++ b/ui/gl/gl_surface_ozone.cc
@@ -15,7 +15,7 @@
#include "ui/gfx/native_widget_types.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_image.h"
-#include "ui/gl/gl_image_linux_dma_buffer.h"
+#include "ui/gl/gl_image_ozone_native_pixmap.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface_egl.h"
#include "ui/gl/gl_surface_osmesa.h"
@@ -428,24 +428,6 @@ class GL_EXPORT GLSurfaceOzoneSurfacelessSurfaceImpl
void Destroy() override;
private:
- class SurfaceImage : public GLImageLinuxDMABuffer {
- public:
- SurfaceImage(const gfx::Size& size, unsigned internalformat);
-
- bool Initialize(scoped_refptr<ui::NativePixmap> pixmap,
- gfx::GpuMemoryBuffer::Format format);
- bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
- int z_order,
- gfx::OverlayTransform transform,
- const gfx::Rect& bounds_rect,
- const gfx::RectF& crop_rect) override;
-
- private:
- ~SurfaceImage() override;
-
- scoped_refptr<ui::NativePixmap> pixmap_;
- };
-
~GLSurfaceOzoneSurfacelessSurfaceImpl() override;
void BindFramebuffer();
@@ -458,35 +440,6 @@ class GL_EXPORT GLSurfaceOzoneSurfacelessSurfaceImpl
DISALLOW_COPY_AND_ASSIGN(GLSurfaceOzoneSurfacelessSurfaceImpl);
};
-GLSurfaceOzoneSurfacelessSurfaceImpl::SurfaceImage::SurfaceImage(
- const gfx::Size& size,
- unsigned internalformat)
- : GLImageLinuxDMABuffer(size, internalformat) {
-}
-
-bool GLSurfaceOzoneSurfacelessSurfaceImpl::SurfaceImage::Initialize(
- scoped_refptr<ui::NativePixmap> pixmap,
- gfx::GpuMemoryBuffer::Format format) {
- base::FileDescriptor handle(pixmap->GetDmaBufFd(), false);
- if (!GLImageLinuxDMABuffer::Initialize(handle, format,
- pixmap->GetDmaBufPitch()))
- return false;
- pixmap_ = pixmap;
- return true;
-}
-bool GLSurfaceOzoneSurfacelessSurfaceImpl::SurfaceImage::ScheduleOverlayPlane(
- gfx::AcceleratedWidget widget,
- int z_order,
- gfx::OverlayTransform transform,
- const gfx::Rect& bounds_rect,
- const gfx::RectF& crop_rect) {
- return pixmap_->ScheduleOverlayPlane(widget, z_order, transform, bounds_rect,
- crop_rect);
-}
-
-GLSurfaceOzoneSurfacelessSurfaceImpl::SurfaceImage::~SurfaceImage() {
-}
-
GLSurfaceOzoneSurfacelessSurfaceImpl::GLSurfaceOzoneSurfacelessSurfaceImpl(
scoped_ptr<ui::SurfaceOzoneEGL> ozone_surface,
AcceleratedWidget widget)
@@ -593,9 +546,10 @@ bool GLSurfaceOzoneSurfacelessSurfaceImpl::CreatePixmaps() {
ui::SurfaceFactoryOzone::SCANOUT);
if (!pixmap)
return false;
- scoped_refptr<SurfaceImage> image =
- new SurfaceImage(GetSize(), GL_BGRA_EXT);
- if (!image->Initialize(pixmap, gfx::GpuMemoryBuffer::Format::BGRA_8888))
+ scoped_refptr<GLImageOzoneNativePixmap> image =
+ new GLImageOzoneNativePixmap(GetSize(), GL_BGRA_EXT);
+ if (!image->Initialize(pixmap.get(),
+ gfx::GpuMemoryBuffer::Format::BGRA_8888))
return false;
images_[i] = image;
// Bind image to texture.
« no previous file with comments | « ui/gl/gl_image_ozone_native_pixmap.cc ('k') | ui/ozone/demo/ozone_demo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698