Bug 1282306 - More correctly describe APZ touch support in about:support. r=botond

Instead of just reporting the value of the pref, also make sure that about:support
incorporates the runtime check of whether or not a touch device was discovered
in the widget code. The code to do this already exists in TouchEvent::PrefEnabled,
so we can just reuse that.

MozReview-Commit-ID: DN7FSlsDwD1

--HG--
extra : rebase_source : efb3d66e1669f8f2b038888ef2b1c8bb83f1c710
This commit is contained in:
Kartikaya Gupta 2017-03-10 15:18:48 -05:00
parent 0c1872f92e
commit e98f75a57a
8 changed files with 9 additions and 24 deletions

View File

@ -66,10 +66,6 @@ public:
virtual already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() override;
virtual bool SupportsApzTouchInput() const override {
return true;
}
protected:
bool AccelerateLayersByDefault() override {
return true;

View File

@ -137,6 +137,7 @@ class mozilla::gl::SkiaGLGlue : public GenericAtomicRefCounted {
#include "SoftwareVsyncSource.h"
#include "nscore.h" // for NS_FREE_PERMANENT_DATA
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/TouchEvent.h"
#include "gfxVR.h"
#include "VRManagerChild.h"
#include "mozilla/gfx/GPUParent.h"
@ -2644,6 +2645,12 @@ gfxPlatform::ImportGPUDeviceData(const mozilla::gfx::GPUDeviceData& aData)
gfxConfig::ImportChange(Feature::OPENGL_COMPOSITING, aData.oglCompositing());
}
bool
gfxPlatform::SupportsApzTouchInput() const
{
return dom::TouchEvent::PrefEnabled(nullptr);
}
bool
gfxPlatform::SupportsApzDragInput() const
{

View File

@ -626,9 +626,7 @@ public:
virtual bool SupportsApzWheelInput() const {
return false;
}
virtual bool SupportsApzTouchInput() const {
return false;
}
bool SupportsApzTouchInput() const;
bool SupportsApzDragInput() const;
virtual void FlushContentDrawing() {}

View File

@ -909,11 +909,4 @@ gfxPlatformGtk::CreateHardwareVsyncSource()
return gfxPlatform::CreateHardwareVsyncSource();
}
bool
gfxPlatformGtk::SupportsApzTouchInput() const
{
int value = gfxPrefs::TouchEventsEnabled();
return value == 1 || value == 2;
}
#endif

View File

@ -123,8 +123,6 @@ public:
return true;
}
bool SupportsApzTouchInput() const override;
void FontsPrefsChanged(const char *aPref) override;
// maximum number of fonts to substitute for a generic

View File

@ -1878,13 +1878,6 @@ gfxWindowsPlatform::CreateHardwareVsyncSource()
return d3dVsyncSource.forget();
}
bool
gfxWindowsPlatform::SupportsApzTouchInput() const
{
int value = gfxPrefs::TouchEventsEnabled();
return value == 1 || value == 2;
}
void
gfxWindowsPlatform::GetAcceleratedCompositorBackends(nsTArray<LayersBackend>& aBackends)
{

View File

@ -209,7 +209,6 @@ public:
bool SupportsApzWheelInput() const override {
return true;
}
bool SupportsApzTouchInput() const override;
// Recreate devices as needed for a device reset. Returns true if a device
// reset occurred.

View File

@ -248,6 +248,7 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/dom/base',
'/dom/workers',
'/dom/xml',
]