diff options
-rw-r--r-- | ui/gl/gl_surface_ozone.cc | 63 | ||||
-rw-r--r-- | ui/ozone/common/stub_overlay_manager.cc | 4 | ||||
-rw-r--r-- | ui/ozone/common/stub_overlay_manager.h | 1 | ||||
-rw-r--r-- | ui/ozone/platform/cast/overlay_manager_cast.cc | 4 | ||||
-rw-r--r-- | ui/ozone/platform/cast/overlay_manager_cast.h | 1 | ||||
-rw-r--r-- | ui/ozone/platform/drm/gpu/gbm_surface_factory.cc | 5 | ||||
-rw-r--r-- | ui/ozone/platform/drm/gpu/gbm_surface_factory.h | 1 | ||||
-rw-r--r-- | ui/ozone/platform/drm/host/drm_overlay_manager.cc | 4 | ||||
-rw-r--r-- | ui/ozone/platform/drm/host/drm_overlay_manager.h | 1 | ||||
-rw-r--r-- | ui/ozone/public/overlay_manager_ozone.h | 5 | ||||
-rw-r--r-- | ui/ozone/public/surface_factory_ozone.cc | 7 | ||||
-rw-r--r-- | ui/ozone/public/surface_factory_ozone.h | 5 |
12 files changed, 35 insertions, 66 deletions
diff --git a/ui/gl/gl_surface_ozone.cc b/ui/gl/gl_surface_ozone.cc index 9f874d4..173b7e4 100644 --- a/ui/gl/gl_surface_ozone.cc +++ b/ui/gl/gl_surface_ozone.cc @@ -564,6 +564,36 @@ bool GLSurfaceOzoneSurfacelessSurfaceImpl::CreatePixmaps() { return true; } +scoped_refptr<GLSurface> CreateViewGLSurfaceOzone( + gfx::AcceleratedWidget window) { + scoped_ptr<ui::SurfaceOzoneEGL> surface_ozone = + ui::OzonePlatform::GetInstance() + ->GetSurfaceFactoryOzone() + ->CreateEGLSurfaceForWidget(window); + if (!surface_ozone) + return nullptr; + scoped_refptr<GLSurface> surface = + new GLSurfaceOzoneEGL(surface_ozone.Pass(), window); + if (!surface->Initialize()) + return nullptr; + return surface; +} + +scoped_refptr<GLSurface> CreateViewGLSurfaceOzoneSurfacelessSurfaceImpl( + gfx::AcceleratedWidget window) { + scoped_ptr<ui::SurfaceOzoneEGL> surface_ozone = + ui::OzonePlatform::GetInstance() + ->GetSurfaceFactoryOzone() + ->CreateSurfacelessEGLSurfaceForWidget(window); + if (!surface_ozone) + return nullptr; + scoped_refptr<GLSurface> surface = + new GLSurfaceOzoneSurfacelessSurfaceImpl(surface_ozone.Pass(), window); + if (!surface->Initialize()) + return nullptr; + return surface; +} + } // namespace // static @@ -589,10 +619,7 @@ scoped_refptr<GLSurface> GLSurface::CreateSurfacelessViewGLSurface( gfx::AcceleratedWidget window) { if (GetGLImplementation() == kGLImplementationEGLGLES2 && window != kNullAcceleratedWidget && - GLSurfaceEGL::IsEGLSurfacelessContextSupported() && - ui::OzonePlatform::GetInstance() - ->GetSurfaceFactoryOzone() - ->CanShowPrimaryPlaneAsOverlay()) { + GLSurfaceEGL::IsEGLSurfacelessContextSupported()) { scoped_ptr<ui::SurfaceOzoneEGL> surface_ozone = ui::OzonePlatform::GetInstance() ->GetSurfaceFactoryOzone() @@ -620,30 +647,10 @@ scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface( DCHECK(GetGLImplementation() == kGLImplementationEGLGLES2); if (window != kNullAcceleratedWidget) { scoped_refptr<GLSurface> surface; - if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() && - ui::OzonePlatform::GetInstance() - ->GetSurfaceFactoryOzone() - ->CanShowPrimaryPlaneAsOverlay()) { - scoped_ptr<ui::SurfaceOzoneEGL> surface_ozone = - ui::OzonePlatform::GetInstance() - ->GetSurfaceFactoryOzone() - ->CreateSurfacelessEGLSurfaceForWidget(window); - if (!surface_ozone) - return NULL; - surface = new GLSurfaceOzoneSurfacelessSurfaceImpl(surface_ozone.Pass(), - window); - } else { - scoped_ptr<ui::SurfaceOzoneEGL> surface_ozone = - ui::OzonePlatform::GetInstance() - ->GetSurfaceFactoryOzone() - ->CreateEGLSurfaceForWidget(window); - if (!surface_ozone) - return NULL; - - surface = new GLSurfaceOzoneEGL(surface_ozone.Pass(), window); - } - if (!surface->Initialize()) - return NULL; + if (GLSurfaceEGL::IsEGLSurfacelessContextSupported()) + surface = CreateViewGLSurfaceOzoneSurfacelessSurfaceImpl(window); + if (!surface) + surface = CreateViewGLSurfaceOzone(window); return surface; } else { scoped_refptr<GLSurface> surface = new GLSurfaceStub(); diff --git a/ui/ozone/common/stub_overlay_manager.cc b/ui/ozone/common/stub_overlay_manager.cc index 45f8a5f..242978d 100644 --- a/ui/ozone/common/stub_overlay_manager.cc +++ b/ui/ozone/common/stub_overlay_manager.cc @@ -18,8 +18,4 @@ scoped_ptr<OverlayCandidatesOzone> StubOverlayManager::CreateOverlayCandidates( return nullptr; } -bool StubOverlayManager::CanShowPrimaryPlaneAsOverlay() { - return false; -} - } // namespace ui diff --git a/ui/ozone/common/stub_overlay_manager.h b/ui/ozone/common/stub_overlay_manager.h index ba72ba0..736b794 100644 --- a/ui/ozone/common/stub_overlay_manager.h +++ b/ui/ozone/common/stub_overlay_manager.h @@ -17,7 +17,6 @@ class StubOverlayManager : public OverlayManagerOzone { // OverlayManagerOzone: scoped_ptr<OverlayCandidatesOzone> CreateOverlayCandidates( gfx::AcceleratedWidget w) override; - bool CanShowPrimaryPlaneAsOverlay() override; private: DISALLOW_COPY_AND_ASSIGN(StubOverlayManager); diff --git a/ui/ozone/platform/cast/overlay_manager_cast.cc b/ui/ozone/platform/cast/overlay_manager_cast.cc index ef09b1f..eea138f 100644 --- a/ui/ozone/platform/cast/overlay_manager_cast.cc +++ b/ui/ozone/platform/cast/overlay_manager_cast.cc @@ -215,8 +215,4 @@ scoped_ptr<OverlayCandidatesOzone> OverlayManagerCast::CreateOverlayCandidates( return make_scoped_ptr(new OverlayCandidatesCast()); } -bool OverlayManagerCast::CanShowPrimaryPlaneAsOverlay() { - return false; -} - } // namespace ui diff --git a/ui/ozone/platform/cast/overlay_manager_cast.h b/ui/ozone/platform/cast/overlay_manager_cast.h index 3eb6a81..2e033a9 100644 --- a/ui/ozone/platform/cast/overlay_manager_cast.h +++ b/ui/ozone/platform/cast/overlay_manager_cast.h @@ -18,7 +18,6 @@ class OverlayManagerCast : public OverlayManagerOzone { // OverlayManagerOzone: scoped_ptr<OverlayCandidatesOzone> CreateOverlayCandidates( gfx::AcceleratedWidget w) override; - bool CanShowPrimaryPlaneAsOverlay() override; private: diff --git a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc index cdff24b..9a1d641 100644 --- a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc +++ b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc @@ -116,11 +116,6 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( return pixmap; } -bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { - DCHECK(thread_checker_.CalledOnValidThread()); - return true; -} - scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( gfx::AcceleratedWidget widget) { return static_cast<GbmDevice*>( diff --git a/ui/ozone/platform/drm/gpu/gbm_surface_factory.h b/ui/ozone/platform/drm/gpu/gbm_surface_factory.h index e766e9a..0aa433d 100644 --- a/ui/ozone/platform/drm/gpu/gbm_surface_factory.h +++ b/ui/ozone/platform/drm/gpu/gbm_surface_factory.h @@ -40,7 +40,6 @@ class GbmSurfaceFactory : public SurfaceFactoryOzone { gfx::Size size, gfx::BufferFormat format, gfx::BufferUsage usage) override; - bool CanShowPrimaryPlaneAsOverlay() override; private: scoped_refptr<GbmDevice> GetGbmDevice(gfx::AcceleratedWidget widget); diff --git a/ui/ozone/platform/drm/host/drm_overlay_manager.cc b/ui/ozone/platform/drm/host/drm_overlay_manager.cc index 933c6f6..70880db 100644 --- a/ui/ozone/platform/drm/host/drm_overlay_manager.cc +++ b/ui/ozone/platform/drm/host/drm_overlay_manager.cc @@ -30,8 +30,4 @@ scoped_ptr<OverlayCandidatesOzone> DrmOverlayManager::CreateOverlayCandidates( new DrmOverlayCandidatesHost(w, platform_support_host_)); } -bool DrmOverlayManager::CanShowPrimaryPlaneAsOverlay() { - return true; -} - } // namespace ui diff --git a/ui/ozone/platform/drm/host/drm_overlay_manager.h b/ui/ozone/platform/drm/host/drm_overlay_manager.h index cc07229..22402cf 100644 --- a/ui/ozone/platform/drm/host/drm_overlay_manager.h +++ b/ui/ozone/platform/drm/host/drm_overlay_manager.h @@ -19,7 +19,6 @@ class DrmOverlayManager : public OverlayManagerOzone { // OverlayManagerOzone: scoped_ptr<OverlayCandidatesOzone> CreateOverlayCandidates( gfx::AcceleratedWidget w) override; - bool CanShowPrimaryPlaneAsOverlay() override; private: DrmGpuPlatformSupportHost* platform_support_host_; diff --git a/ui/ozone/public/overlay_manager_ozone.h b/ui/ozone/public/overlay_manager_ozone.h index 5e8d94f..a26bdad 100644 --- a/ui/ozone/public/overlay_manager_ozone.h +++ b/ui/ozone/public/overlay_manager_ozone.h @@ -21,11 +21,6 @@ class OverlayManagerOzone { // Get the hal struct to check for overlay support. virtual scoped_ptr<OverlayCandidatesOzone> CreateOverlayCandidates( gfx::AcceleratedWidget w) = 0; - - // 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() = 0; }; } // namespace ui diff --git a/ui/ozone/public/surface_factory_ozone.cc b/ui/ozone/public/surface_factory_ozone.cc index e74bfab..f3aa16b 100644 --- a/ui/ozone/public/surface_factory_ozone.cc +++ b/ui/ozone/public/surface_factory_ozone.cc @@ -25,20 +25,17 @@ intptr_t SurfaceFactoryOzone::GetNativeDisplay() { scoped_ptr<SurfaceOzoneEGL> SurfaceFactoryOzone::CreateEGLSurfaceForWidget( gfx::AcceleratedWidget widget) { - NOTIMPLEMENTED(); return nullptr; } scoped_ptr<SurfaceOzoneEGL> SurfaceFactoryOzone::CreateSurfacelessEGLSurfaceForWidget( gfx::AcceleratedWidget widget) { - NOTIMPLEMENTED(); return nullptr; } scoped_ptr<SurfaceOzoneCanvas> SurfaceFactoryOzone::CreateCanvasForWidget( gfx::AcceleratedWidget widget) { - NOTIMPLEMENTED(); return nullptr; } @@ -55,8 +52,4 @@ scoped_refptr<ui::NativePixmap> SurfaceFactoryOzone::CreateNativePixmap( return NULL; } -bool SurfaceFactoryOzone::CanShowPrimaryPlaneAsOverlay() { - return false; -} - } // namespace ui diff --git a/ui/ozone/public/surface_factory_ozone.h b/ui/ozone/public/surface_factory_ozone.h index 7754e0e..07ab495 100644 --- a/ui/ozone/public/surface_factory_ozone.h +++ b/ui/ozone/public/surface_factory_ozone.h @@ -106,11 +106,6 @@ class OZONE_BASE_EXPORT SurfaceFactoryOzone { gfx::BufferFormat format, gfx::BufferUsage usage); - // 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(); - protected: SurfaceFactoryOzone(); virtual ~SurfaceFactoryOzone(); |