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

Unified Diff: ui/ozone/public/surface_factory_ozone.h

Issue 365193003: Change NativeBufferOzone to be an object and move the overlay calls to the surface object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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/ozone/public/surface_factory_ozone.h
diff --git a/ui/ozone/public/surface_factory_ozone.h b/ui/ozone/public/surface_factory_ozone.h
index 4702d69a59d4e0d0e886b03de92cea7dea007ca6..ccca8cf281af7c5cb861f36c9332426ef797dfda 100644
--- a/ui/ozone/public/surface_factory_ozone.h
+++ b/ui/ozone/public/surface_factory_ozone.h
@@ -6,6 +6,7 @@
#define UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_
#include "base/callback.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/native_library.h"
#include "ui/gfx/geometry/point.h"
@@ -20,11 +21,26 @@ class SkCanvas;
namespace ui {
-typedef intptr_t NativeBufferOzone;
class OverlayCandidatesOzone;
class SurfaceOzoneCanvas;
class SurfaceOzoneEGL;
+// TODO: find a better spot for this to live.
+class NativePixmap : public base::RefCounted<NativePixmap> {
dnicoara 2014/07/03 18:30:17 Just move it in it's own file. And add some comme
+ public:
+ NativePixmap() {}
+
+ virtual void* /* EGLClientBuffer */ native_handle() = 0;
spang 2014/07/03 18:29:09 If this is "get me the handle to pass to EGL" then
dnicoara 2014/07/03 18:30:17 I believe these should follow the normal naming co
achaulk 2014/07/03 19:49:43 Done.
+ virtual int dma_buf_fd() = 0;
+
+ protected:
+ virtual ~NativePixmap() {}
+
+ friend class base::RefCounted<NativePixmap>;
+
+ DISALLOW_COPY_AND_ASSIGN(NativePixmap);
+};
+
// The Ozone interface allows external implementations to hook into Chromium to
// provide a system specific implementation. The Ozone interface supports two
// drawing modes: 1) accelerated drawing through EGL and 2) software drawing
@@ -134,25 +150,14 @@ class OZONE_BASE_EXPORT SurfaceFactoryOzone {
virtual OverlayCandidatesOzone* GetOverlayCandidates(
gfx::AcceleratedWidget w);
- // Sets the overlay plane to switch to at the next page flip.
- // |plane_z_order| specifies the stacking order of the plane relative to the
- // main framebuffer located at index 0.
- // |plane_transform| specifies how the buffer is to be transformed during.
- // composition.
- // |buffer| to be presented by the overlay.
- // |display_bounds| specify where it is supposed to be on the screen.
- // |crop_rect| specifies the region within the buffer to be placed inside
- // |display_bounds|.
- virtual void ScheduleOverlayPlane(gfx::AcceleratedWidget w,
- int plane_z_order,
- gfx::OverlayTransform plane_transform,
- ui::NativeBufferOzone buffer,
- const gfx::Rect& display_bounds,
- gfx::RectF crop_rect);
-
// Cleate a single native buffer to be used for overlay planes.
- virtual ui::NativeBufferOzone CreateNativeBuffer(gfx::Size size,
- BufferFormat format);
+ virtual scoped_refptr<ui::NativePixmap> CreateNativeBuffer(
+ gfx::Size size, BufferFormat format);
spang 2014/07/03 18:29:09 seems rather inconsistent. CreateNativePixmap
achaulk 2014/07/03 19:49:44 Done.
+
+ // Returns true if overlays can be shown at z-index 0, replacing the main
+ // surface. Combined with surfaceless extensions, it allows for an
+ // overlay-only mode.
+ virtual bool CanShowPrimaryPlaneAsOverlay();
spang 2014/07/03 18:29:09 thanks
private:
static SurfaceFactoryOzone* impl_; // not owned

Powered by Google App Engine
This is Rietveld 408576698