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:
eyim 2016-05-27 16:46:25 -04:00
Родитель 3d4c047c6b
Коммит 3767f26135
7 изменённых файлов: 22 добавлений и 19 удалений

Просмотреть файл

@ -5,7 +5,7 @@
#include "APZCCallbackHelper.h"
#include "ContentHelper.h"
#include "TouchActionHelper.h"
#include "gfxPlatform.h" // For gfxPlatform::UseTiling
#include "gfxPrefs.h"
#include "LayersLogging.h" // For Stringify
@ -787,7 +787,7 @@ APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(
nsTArray<TouchBehaviorFlags> flags;
for (uint32_t i = 0; i < aEvent.mTouches.Length(); i++) {
flags.AppendElement(
widget::ContentHelper::GetAllowedTouchBehavior(
widget::TouchActionHelper::GetAllowedTouchBehavior(
aWidget, aEvent.mTouches[i]->mRefPoint));
}
aCallback(aInputBlockId, Move(flags));

Просмотреть файл

@ -3,7 +3,7 @@
* 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/. */
#include "ContentHelper.h"
#include "TouchActionHelper.h"
#include "nsContainerFrame.h"
#include "nsIContent.h"
@ -16,7 +16,7 @@ namespace mozilla {
namespace widget {
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) {
// Double-tap-zooming need property value AUTO
@ -43,8 +43,8 @@ ContentHelper::UpdateAllowedBehavior(uint32_t aTouchActionValue, bool aConsiderP
}
}
ContentHelper::TouchBehaviorFlags
ContentHelper::GetAllowedTouchBehavior(nsIWidget* aWidget, const LayoutDeviceIntPoint& aPoint)
mozilla::layers::TouchBehaviorFlags
TouchActionHelper::GetAllowedTouchBehavior(nsIWidget* aWidget, const LayoutDeviceIntPoint& aPoint)
{
nsView *view = nsView::GetViewFor(aWidget);
nsIFrame *viewFrame = view->GetFrame();

Просмотреть файл

@ -3,12 +3,13 @@
* 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/. */
#ifndef __mozilla_widget_ContentHelper_h__
#define __mozilla_widget_ContentHelper_h__
#ifndef __mozilla_layers_TouchActionHelper_h__
#define __mozilla_layers_TouchActionHelper_h__
#include "nsIFrame.h"
#include "nsIWidget.h"
#include "mozilla/layers/APZCTreeManager.h"
#include "mozilla/layers/APZUtils.h"
namespace mozilla {
namespace widget {
@ -16,13 +17,12 @@ namespace widget {
/*
* Allow different platform widgets to access Content/DOM stuff.
*/
class ContentHelper
class TouchActionHelper
{
typedef mozilla::layers::AllowedTouchBehavior AllowedTouchBehavior;
typedef uint32_t TouchBehaviorFlags;
private:
static void UpdateAllowedBehavior(uint32_t aTouchActionValue, bool aConsiderPanning, TouchBehaviorFlags& aOutBehavior);
static void UpdateAllowedBehavior(uint32_t aTouchActionValue, bool aConsiderPanning, mozilla::layers::TouchBehaviorFlags& aOutBehavior);
public:
/*
@ -30,10 +30,10 @@ public:
* 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.
*/
static TouchBehaviorFlags GetAllowedTouchBehavior(nsIWidget* aWidget, const LayoutDeviceIntPoint& aPoint);
static mozilla::layers::TouchBehaviorFlags GetAllowedTouchBehavior(nsIWidget* aWidget, const LayoutDeviceIntPoint& aPoint);
};
} // namespace widget
} // 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/ScrollInputMethods.h',
'apz/util/ScrollLinkedEffectDetector.h',
'apz/util/TouchActionHelper.h',
'AsyncCanvasRenderer.h',
'AtomicRefCountedWithFinalize.h',
'AxisPhysicsModel.h',
@ -284,6 +285,7 @@ UNIFIED_SOURCES += [
'apz/util/DoubleTapToZoom.cpp',
'apz/util/InputAPZContext.cpp',
'apz/util/ScrollLinkedEffectDetector.cpp',
'apz/util/TouchActionHelper.cpp',
'AsyncCanvasRenderer.cpp',
'AxisPhysicsModel.cpp',
'AxisPhysicsMSDModel.cpp',

Просмотреть файл

@ -21,6 +21,8 @@
#include "PuppetWidget.h"
#include "nsContentUtils.h"
#include "nsIWidgetListener.h"
#include "imgIContainer.h"
#include "nsView.h"
using namespace mozilla;
using namespace mozilla::dom;

Просмотреть файл

@ -88,7 +88,6 @@ XPIDL_MODULE = 'widget'
EXPORTS += [
'CompositorWidgetProxy.h',
'ContentHelper.h',
'GfxDriverInfo.h',
'GfxInfoBase.h',
'GfxInfoCollector.h',
@ -137,14 +136,12 @@ EXPORTS.mozilla.widget += [
UNIFIED_SOURCES += [
'CompositorWidgetProxy.cpp',
'ContentCache.cpp',
'ContentHelper.cpp',
'GfxDriverInfo.cpp',
'GfxInfoBase.cpp',
'GfxInfoCollector.cpp',
'GfxInfoWebGL.cpp',
'InputData.cpp',
'nsBaseAppShell.cpp',
'nsBaseDragService.cpp',
'nsBaseScreen.cpp',
'nsClipboardHelper.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
# nsBaseDragService.cpp moved out of UNIFIED to fix xgill crash (bug 1259850) after moving widget/ContentHelper -> apz/util/TouchActionHelper
SOURCES += [
'nsBaseWidget.cpp',
'nsBaseDragService.cpp',
'nsBaseWidget.cpp'
]
if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']:

Просмотреть файл

@ -79,7 +79,7 @@ nsDeviceContextSpecProxy::GetSurfaceForPrinter(gfxASurface** aSurface)
RefPtr<gfxASurface> surface = gfxPlatform::GetPlatform()->
CreateOffscreenSurface(mozilla::gfx::IntSize(width, height),
SurfaceFormat::A8R8G8B8_UINT32);
mozilla::gfx::SurfaceFormat::A8R8G8B8_UINT32);
surface.forget(aSurface);
return NS_OK;
@ -115,7 +115,7 @@ nsDeviceContextSpecProxy::BeginDocument(const nsAString& aTitle,
const nsAString& aPrintToFileName,
int32_t aStartPage, int32_t aEndPage)
{
mRecorder = new DrawEventRecorderMemory();
mRecorder = new mozilla::gfx::DrawEventRecorderMemory();
return mRemotePrintJob->InitializePrint(nsString(aTitle),
nsString(aPrintToFileName),
aStartPage, aEndPage);