зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1145085 - Move widget/ContentHelper.* to gfx/layers/apz/util/TouchActionHelper.*. r=BenWa,kats
r?BenWa,kats MozReview-Commit-ID: 5snt3fIGnAS --HG-- rename : widget/ContentHelper.cpp => gfx/layers/apz/util/TouchActionHelper.cpp rename : widget/ContentHelper.h => gfx/layers/apz/util/TouchActionHelper.h extra : rebase_source : 58250f060aefec4a8f9551f679d210bcdc849719
This commit is contained in:
Родитель
3d4c047c6b
Коммит
3767f26135
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "APZCCallbackHelper.h"
|
#include "APZCCallbackHelper.h"
|
||||||
|
|
||||||
#include "ContentHelper.h"
|
#include "TouchActionHelper.h"
|
||||||
#include "gfxPlatform.h" // For gfxPlatform::UseTiling
|
#include "gfxPlatform.h" // For gfxPlatform::UseTiling
|
||||||
#include "gfxPrefs.h"
|
#include "gfxPrefs.h"
|
||||||
#include "LayersLogging.h" // For Stringify
|
#include "LayersLogging.h" // For Stringify
|
||||||
|
@ -787,7 +787,7 @@ APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(
|
||||||
nsTArray<TouchBehaviorFlags> flags;
|
nsTArray<TouchBehaviorFlags> flags;
|
||||||
for (uint32_t i = 0; i < aEvent.mTouches.Length(); i++) {
|
for (uint32_t i = 0; i < aEvent.mTouches.Length(); i++) {
|
||||||
flags.AppendElement(
|
flags.AppendElement(
|
||||||
widget::ContentHelper::GetAllowedTouchBehavior(
|
widget::TouchActionHelper::GetAllowedTouchBehavior(
|
||||||
aWidget, aEvent.mTouches[i]->mRefPoint));
|
aWidget, aEvent.mTouches[i]->mRefPoint));
|
||||||
}
|
}
|
||||||
aCallback(aInputBlockId, Move(flags));
|
aCallback(aInputBlockId, Move(flags));
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "ContentHelper.h"
|
#include "TouchActionHelper.h"
|
||||||
|
|
||||||
#include "nsContainerFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
|
@ -16,7 +16,7 @@ namespace mozilla {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
|
|
||||||
void
|
void
|
||||||
ContentHelper::UpdateAllowedBehavior(uint32_t aTouchActionValue, bool aConsiderPanning, TouchBehaviorFlags& aOutBehavior)
|
TouchActionHelper::UpdateAllowedBehavior(uint32_t aTouchActionValue, bool aConsiderPanning, mozilla::layers::TouchBehaviorFlags& aOutBehavior)
|
||||||
{
|
{
|
||||||
if (aTouchActionValue != NS_STYLE_TOUCH_ACTION_AUTO) {
|
if (aTouchActionValue != NS_STYLE_TOUCH_ACTION_AUTO) {
|
||||||
// Double-tap-zooming need property value AUTO
|
// Double-tap-zooming need property value AUTO
|
||||||
|
@ -43,8 +43,8 @@ ContentHelper::UpdateAllowedBehavior(uint32_t aTouchActionValue, bool aConsiderP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentHelper::TouchBehaviorFlags
|
mozilla::layers::TouchBehaviorFlags
|
||||||
ContentHelper::GetAllowedTouchBehavior(nsIWidget* aWidget, const LayoutDeviceIntPoint& aPoint)
|
TouchActionHelper::GetAllowedTouchBehavior(nsIWidget* aWidget, const LayoutDeviceIntPoint& aPoint)
|
||||||
{
|
{
|
||||||
nsView *view = nsView::GetViewFor(aWidget);
|
nsView *view = nsView::GetViewFor(aWidget);
|
||||||
nsIFrame *viewFrame = view->GetFrame();
|
nsIFrame *viewFrame = view->GetFrame();
|
|
@ -3,12 +3,13 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#ifndef __mozilla_widget_ContentHelper_h__
|
#ifndef __mozilla_layers_TouchActionHelper_h__
|
||||||
#define __mozilla_widget_ContentHelper_h__
|
#define __mozilla_layers_TouchActionHelper_h__
|
||||||
|
|
||||||
#include "nsIFrame.h"
|
#include "nsIFrame.h"
|
||||||
#include "nsIWidget.h"
|
#include "nsIWidget.h"
|
||||||
#include "mozilla/layers/APZCTreeManager.h"
|
#include "mozilla/layers/APZCTreeManager.h"
|
||||||
|
#include "mozilla/layers/APZUtils.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
|
@ -16,13 +17,12 @@ namespace widget {
|
||||||
/*
|
/*
|
||||||
* Allow different platform widgets to access Content/DOM stuff.
|
* Allow different platform widgets to access Content/DOM stuff.
|
||||||
*/
|
*/
|
||||||
class ContentHelper
|
class TouchActionHelper
|
||||||
{
|
{
|
||||||
typedef mozilla::layers::AllowedTouchBehavior AllowedTouchBehavior;
|
typedef mozilla::layers::AllowedTouchBehavior AllowedTouchBehavior;
|
||||||
typedef uint32_t TouchBehaviorFlags;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void UpdateAllowedBehavior(uint32_t aTouchActionValue, bool aConsiderPanning, TouchBehaviorFlags& aOutBehavior);
|
static void UpdateAllowedBehavior(uint32_t aTouchActionValue, bool aConsiderPanning, mozilla::layers::TouchBehaviorFlags& aOutBehavior);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*
|
/*
|
||||||
|
@ -30,10 +30,10 @@ public:
|
||||||
* touch-action css property value from it according the rules specified in the spec:
|
* touch-action css property value from it according the rules specified in the spec:
|
||||||
* http://www.w3.org/TR/pointerevents/#the-touch-action-css-property.
|
* http://www.w3.org/TR/pointerevents/#the-touch-action-css-property.
|
||||||
*/
|
*/
|
||||||
static TouchBehaviorFlags GetAllowedTouchBehavior(nsIWidget* aWidget, const LayoutDeviceIntPoint& aPoint);
|
static mozilla::layers::TouchBehaviorFlags GetAllowedTouchBehavior(nsIWidget* aWidget, const LayoutDeviceIntPoint& aPoint);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace widget
|
} // namespace widget
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
#endif /*__mozilla_widget_ContentHelper_h__ */
|
#endif /*__mozilla_layers_TouchActionHelper_h__ */
|
|
@ -115,6 +115,7 @@ EXPORTS.mozilla.layers += [
|
||||||
'apz/util/InputAPZContext.h',
|
'apz/util/InputAPZContext.h',
|
||||||
'apz/util/ScrollInputMethods.h',
|
'apz/util/ScrollInputMethods.h',
|
||||||
'apz/util/ScrollLinkedEffectDetector.h',
|
'apz/util/ScrollLinkedEffectDetector.h',
|
||||||
|
'apz/util/TouchActionHelper.h',
|
||||||
'AsyncCanvasRenderer.h',
|
'AsyncCanvasRenderer.h',
|
||||||
'AtomicRefCountedWithFinalize.h',
|
'AtomicRefCountedWithFinalize.h',
|
||||||
'AxisPhysicsModel.h',
|
'AxisPhysicsModel.h',
|
||||||
|
@ -284,6 +285,7 @@ UNIFIED_SOURCES += [
|
||||||
'apz/util/DoubleTapToZoom.cpp',
|
'apz/util/DoubleTapToZoom.cpp',
|
||||||
'apz/util/InputAPZContext.cpp',
|
'apz/util/InputAPZContext.cpp',
|
||||||
'apz/util/ScrollLinkedEffectDetector.cpp',
|
'apz/util/ScrollLinkedEffectDetector.cpp',
|
||||||
|
'apz/util/TouchActionHelper.cpp',
|
||||||
'AsyncCanvasRenderer.cpp',
|
'AsyncCanvasRenderer.cpp',
|
||||||
'AxisPhysicsModel.cpp',
|
'AxisPhysicsModel.cpp',
|
||||||
'AxisPhysicsMSDModel.cpp',
|
'AxisPhysicsMSDModel.cpp',
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
#include "PuppetWidget.h"
|
#include "PuppetWidget.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsIWidgetListener.h"
|
#include "nsIWidgetListener.h"
|
||||||
|
#include "imgIContainer.h"
|
||||||
|
#include "nsView.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
|
|
|
@ -88,7 +88,6 @@ XPIDL_MODULE = 'widget'
|
||||||
|
|
||||||
EXPORTS += [
|
EXPORTS += [
|
||||||
'CompositorWidgetProxy.h',
|
'CompositorWidgetProxy.h',
|
||||||
'ContentHelper.h',
|
|
||||||
'GfxDriverInfo.h',
|
'GfxDriverInfo.h',
|
||||||
'GfxInfoBase.h',
|
'GfxInfoBase.h',
|
||||||
'GfxInfoCollector.h',
|
'GfxInfoCollector.h',
|
||||||
|
@ -137,14 +136,12 @@ EXPORTS.mozilla.widget += [
|
||||||
UNIFIED_SOURCES += [
|
UNIFIED_SOURCES += [
|
||||||
'CompositorWidgetProxy.cpp',
|
'CompositorWidgetProxy.cpp',
|
||||||
'ContentCache.cpp',
|
'ContentCache.cpp',
|
||||||
'ContentHelper.cpp',
|
|
||||||
'GfxDriverInfo.cpp',
|
'GfxDriverInfo.cpp',
|
||||||
'GfxInfoBase.cpp',
|
'GfxInfoBase.cpp',
|
||||||
'GfxInfoCollector.cpp',
|
'GfxInfoCollector.cpp',
|
||||||
'GfxInfoWebGL.cpp',
|
'GfxInfoWebGL.cpp',
|
||||||
'InputData.cpp',
|
'InputData.cpp',
|
||||||
'nsBaseAppShell.cpp',
|
'nsBaseAppShell.cpp',
|
||||||
'nsBaseDragService.cpp',
|
|
||||||
'nsBaseScreen.cpp',
|
'nsBaseScreen.cpp',
|
||||||
'nsClipboardHelper.cpp',
|
'nsClipboardHelper.cpp',
|
||||||
'nsClipboardProxy.cpp',
|
'nsClipboardProxy.cpp',
|
||||||
|
@ -183,8 +180,10 @@ if CONFIG['MOZ_XUL'] and CONFIG['NS_PRINTING']:
|
||||||
]
|
]
|
||||||
|
|
||||||
# nsBaseWidget.cpp needs to be built separately because of name clashes in the OS X headers
|
# nsBaseWidget.cpp needs to be built separately because of name clashes in the OS X headers
|
||||||
|
# nsBaseDragService.cpp moved out of UNIFIED to fix xgill crash (bug 1259850) after moving widget/ContentHelper -> apz/util/TouchActionHelper
|
||||||
SOURCES += [
|
SOURCES += [
|
||||||
'nsBaseWidget.cpp',
|
'nsBaseDragService.cpp',
|
||||||
|
'nsBaseWidget.cpp'
|
||||||
]
|
]
|
||||||
|
|
||||||
if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']:
|
if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']:
|
||||||
|
|
|
@ -79,7 +79,7 @@ nsDeviceContextSpecProxy::GetSurfaceForPrinter(gfxASurface** aSurface)
|
||||||
|
|
||||||
RefPtr<gfxASurface> surface = gfxPlatform::GetPlatform()->
|
RefPtr<gfxASurface> surface = gfxPlatform::GetPlatform()->
|
||||||
CreateOffscreenSurface(mozilla::gfx::IntSize(width, height),
|
CreateOffscreenSurface(mozilla::gfx::IntSize(width, height),
|
||||||
SurfaceFormat::A8R8G8B8_UINT32);
|
mozilla::gfx::SurfaceFormat::A8R8G8B8_UINT32);
|
||||||
|
|
||||||
surface.forget(aSurface);
|
surface.forget(aSurface);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -115,7 +115,7 @@ nsDeviceContextSpecProxy::BeginDocument(const nsAString& aTitle,
|
||||||
const nsAString& aPrintToFileName,
|
const nsAString& aPrintToFileName,
|
||||||
int32_t aStartPage, int32_t aEndPage)
|
int32_t aStartPage, int32_t aEndPage)
|
||||||
{
|
{
|
||||||
mRecorder = new DrawEventRecorderMemory();
|
mRecorder = new mozilla::gfx::DrawEventRecorderMemory();
|
||||||
return mRemotePrintJob->InitializePrint(nsString(aTitle),
|
return mRemotePrintJob->InitializePrint(nsString(aTitle),
|
||||||
nsString(aPrintToFileName),
|
nsString(aPrintToFileName),
|
||||||
aStartPage, aEndPage);
|
aStartPage, aEndPage);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче