From 42f3bf772bab75d639b9211d66a0e085538526e2 Mon Sep 17 00:00:00 2001 From: Donald Carr Date: Tue, 10 Apr 2012 17:20:31 +0000 Subject: Extend eglhooks to include hasCapability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add BufferQueueingOpenGL to Raspberry PI's numerous capabilities Change-Id: I1197c28a0c82df3ae2f6d5360791010e17373555 Reviewed-by: Girish Ramakrishnan Reviewed-by: Donald Carr Reviewed-by: Samuel Rødal --- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/platforms/eglfs/qeglfsintegration.cpp') diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index d9214f87fe..b1f5a69570 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -74,6 +74,10 @@ QEglFSIntegration::~QEglFSIntegration() bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) const { + // We assume that devices will have more and not less capabilities + if (hooks && hooks->hasCapability(cap)) + return true; + switch (cap) { case ThreadedPixmaps: return true; case OpenGL: return true; -- cgit v1.2.3 From e60ca0de6015a8ee16c7be54d0d430252ef525c1 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 10 Apr 2012 22:06:48 -0700 Subject: eglfs: rework hooks design MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are two problems with the current design: 1. if (hooks) hooks->foo() doesn't work in debug mode when no platform hook is defined. The problem doesn't arise in release mode because the compiler optimizes away the if (hooks) into a no-op since hooks is NULL when no platform hook is defined. 2. Adding a new hook requires changing every platform's hook implementation. New approach: 1. Define QEglFSHooks as a class with virtual functions. A stub file provides the default implementation. 2. Platform hooks derive from above class and reimplement whatever is needed. The filenames and variables have been changed to be more in line with the Qt style. Change-Id: I2eaaa5ad7c8b48a06361c4747d4f210c428c983f Reviewed-by: Samuel Rødal --- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/eglfs/qeglfsintegration.cpp') diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index b1f5a69570..9b7d9246f9 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -43,7 +43,7 @@ #include "qeglfswindow.h" #include "qeglfsbackingstore.h" -#include "qeglfs_hooks.h" +#include "qeglfshooks.h" #include #include -- cgit v1.2.3