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

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

Issue 706273002: Add ability to query and allocate zero copy buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/ozone/platform/dri/gbm_surface_factory.cc ('k') | ui/ozone/public/surface_factory_ozone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 62df13e50740423de6567804d69e4c010eb5c40f..d130de0575e2bcf9bb06a3fc173572ab949fdf4a 100644
--- a/ui/ozone/public/surface_factory_ozone.h
+++ b/ui/ozone/public/surface_factory_ozone.h
@@ -68,6 +68,11 @@ class OZONE_BASE_EXPORT SurfaceFactoryOzone {
RGB_888,
};
+ enum BufferUsage {
+ MAP,
spang 2014/11/07 17:42:06 do we ever want both (MAP | SCANOUT)?
+ SCANOUT,
+ };
+
typedef void* (*GLGetProcAddressProc)(const char* name);
typedef base::Callback<void(base::NativeLibrary)> AddGLLibraryCallback;
typedef base::Callback<void(GLGetProcAddressProc)>
@@ -121,10 +126,10 @@ class OZONE_BASE_EXPORT SurfaceFactoryOzone {
virtual OverlayCandidatesOzone* GetOverlayCandidates(
gfx::AcceleratedWidget w);
- // Cleate a single native buffer to be used for overlay planes.
- virtual scoped_refptr<NativePixmap> CreateNativePixmap(
- gfx::Size size,
- BufferFormat format);
+ // Cleate a single native buffer to be used for overlay planes or zero copy.
+ virtual scoped_refptr<NativePixmap> CreateNativePixmap(gfx::Size size,
+ BufferFormat format,
+ BufferUsage usage);
// Sets the overlay plane to switch to at the next page flip.
// |w| specifies the screen to display this overlay plane on.
@@ -149,6 +154,10 @@ class OZONE_BASE_EXPORT SurfaceFactoryOzone {
// overlay-only mode.
virtual bool CanShowPrimaryPlaneAsOverlay();
+ // Returns true if the platform is able to create buffers for a specific usage
+ // such as MAP for zero copy or SCANOUT for display controller.
+ virtual bool CanCreateNativePixmap(BufferUsage usage);
+
private:
static SurfaceFactoryOzone* impl_; // not owned
};
« no previous file with comments | « ui/ozone/platform/dri/gbm_surface_factory.cc ('k') | ui/ozone/public/surface_factory_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698