Bug 1130455 - Remove the ScrollingBehavior code to propagate APZ and use gfxPrefs instead. r=roc,fabrice

The ScrollingBehavior passed around extensively in TabParent/TabChild is
entirely redundant now that the layers.async-pan-zoom.enabled pref definitively
controls whether or not APZ is enabled. All the code related to ScrollingBehavior
can be removed.
This commit is contained in:
Kartikaya Gupta 2015-02-26 08:47:01 -05:00
Родитель 4ebb7ef7d1
Коммит 2ccb1ce2ad
16 изменённых файлов: 44 добавлений и 179 удалений

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

@ -13818,10 +13818,6 @@ nsDocShell::GetAppManifestURL(nsAString& aAppManifestURL)
NS_IMETHODIMP
nsDocShell::GetAsyncPanZoomEnabled(bool* aOut)
{
if (TabChild* tabChild = TabChild::GetFrom(this)) {
*aOut = tabChild->IsAsyncPanZoomEnabled();
return NS_OK;
}
*aOut = Preferences::GetBool("layers.async-pan-zoom.enabled", false);
return NS_OK;
}

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

@ -2146,20 +2146,15 @@ nsFrameLoader::TryRemoteBrowser()
MutableTabContext context;
nsCOMPtr<mozIApplication> ownApp = GetOwnApp();
nsCOMPtr<mozIApplication> containingApp = GetContainingApp();
ScrollingBehavior scrollingBehavior = DEFAULT_SCROLLING;
if (Preferences::GetBool("layers.async-pan-zoom.enabled", false)) {
scrollingBehavior = ASYNC_PAN_ZOOM;
}
bool rv = true;
if (ownApp) {
rv = context.SetTabContextForAppFrame(ownApp, containingApp, scrollingBehavior);
rv = context.SetTabContextForAppFrame(ownApp, containingApp);
} else if (OwnerIsBrowserFrame()) {
// The |else| above is unnecessary; OwnerIsBrowserFrame() implies !ownApp.
rv = context.SetTabContextForBrowserFrame(containingApp, scrollingBehavior);
rv = context.SetTabContextForBrowserFrame(containingApp);
} else {
rv = context.SetTabContextForNormalFrame(scrollingBehavior);
rv = context.SetTabContextForNormalFrame();
}
NS_ENSURE_TRUE(rv, false);

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

@ -31,7 +31,6 @@ using struct mozilla::layers::FrameMetrics from "FrameMetrics.h";
using struct mozilla::layers::ScrollableLayerGuid from "FrameMetrics.h";
using struct mozilla::layers::ZoomConstraints from "FrameMetrics.h";
using FrameMetrics::ViewID from "FrameMetrics.h";
using mozilla::layout::ScrollingBehavior from "mozilla/layout/RenderFrameUtils.h";
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
using mozilla::WindowsHandle from "ipc/IPCMessageUtils.h";
using nscolor from "nsColor.h";
@ -474,8 +473,7 @@ parent:
async RemotePaintIsReady();
sync GetRenderFrameInfo(PRenderFrame aRenderFrame)
returns (ScrollingBehavior scrolling,
TextureFactoryIdentifier textureFactoryIdentifier,
returns (TextureFactoryIdentifier textureFactoryIdentifier,
uint64_t layersId);
/**
@ -496,7 +494,6 @@ child:
*/
Show(nsIntSize size,
ShowInfo info,
ScrollingBehavior scrolling,
TextureFactoryIdentifier textureFactoryIdentifier,
uint64_t layersId,
nullable PRenderFrame renderFrame,

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

@ -7,8 +7,6 @@
include protocol PBrowser;
include PBrowserOrId;
using mozilla::layout::ScrollingBehavior from "mozilla/layout/RenderFrameUtils.h";
namespace mozilla {
namespace dom {
@ -70,7 +68,6 @@ union IPCTabAppBrowserContext
struct IPCTabContext {
IPCTabAppBrowserContext appBrowserContext;
ScrollingBehavior scrollingBehavior;
};
}

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

@ -267,7 +267,7 @@ CSSToParentLayerScale ConvertScaleForRoot(CSSToScreenScale aScale) {
bool
TabChildBase::HandlePossibleViewportChange(const ScreenIntSize& aOldScreenSize)
{
if (!IsAsyncPanZoomEnabled()) {
if (!gfxPrefs::AsyncPanZoomEnabled()) {
return false;
}
@ -556,12 +556,6 @@ TabChildBase::ProcessUpdateFrame(const FrameMetrics& aFrameMetrics)
return newMetrics;
}
bool
TabChildBase::IsAsyncPanZoomEnabled()
{
return mScrolling == ASYNC_PAN_ZOOM;
}
NS_IMETHODIMP
ContentListener::HandleEvent(nsIDOMEvent* aEvent)
{
@ -907,7 +901,7 @@ TabChild::Observe(nsISupports *aSubject,
}
}
} else if (!strcmp(aTopic, BEFORE_FIRST_PAINT)) {
if (IsAsyncPanZoomEnabled()) {
if (gfxPrefs::AsyncPanZoomEnabled()) {
nsCOMPtr<nsIDocument> subject(do_QueryInterface(aSubject));
nsCOMPtr<nsIDocument> doc(GetDocument());
@ -962,7 +956,7 @@ TabChild::OnLocationChange(nsIWebProgress* aWebProgress,
nsIURI *aLocation,
uint32_t aFlags)
{
if (!IsAsyncPanZoomEnabled()) {
if (!gfxPrefs::AsyncPanZoomEnabled()) {
return NS_OK;
}
@ -1437,7 +1431,7 @@ TabChild::ProvideWindowCommon(nsIDOMWindow* aOpener,
context.opener() = openerTabId;
context.isBrowserElement() = IsBrowserElement();
IPCTabContext ipcContext(context, mScrolling);
IPCTabContext ipcContext(context);
TabId tabId;
cc->SendAllocateTabId(openerTabId,
@ -1455,7 +1449,7 @@ TabChild::ProvideWindowCommon(nsIDOMWindow* aOpener,
unused << Manager()->SendPBrowserConstructor(
// We release this ref in DeallocPBrowserChild
nsRefPtr<TabChild>(newChild).forget().take(),
tabId, IPCTabContext(context, mScrolling), aChromeFlags,
tabId, IPCTabContext(context), aChromeFlags,
cc->GetID(), cc->IsForApp(), cc->IsForBrowser());
nsAutoCString spec;
@ -1517,12 +1511,10 @@ TabChild::ProvideWindowCommon(nsIDOMWindow* aOpener,
return NS_ERROR_ABORT;
}
ScrollingBehavior scrolling = DEFAULT_SCROLLING;
TextureFactoryIdentifier textureFactoryIdentifier;
uint64_t layersId = 0;
PRenderFrameChild* renderFrame = newChild->SendPRenderFrameConstructor();
newChild->SendGetRenderFrameInfo(renderFrame,
&scrolling,
&textureFactoryIdentifier,
&layersId);
if (layersId == 0) { // if renderFrame is invalid.
@ -1532,7 +1524,7 @@ TabChild::ProvideWindowCommon(nsIDOMWindow* aOpener,
// Unfortunately we don't get a window unless we've shown the frame. That's
// pretty bogus; see bug 763602.
newChild->DoFakeShow(scrolling, textureFactoryIdentifier, layersId, renderFrame);
newChild->DoFakeShow(textureFactoryIdentifier, layersId, renderFrame);
for (size_t i = 0; i < frameScripts.Length(); i++) {
FrameScriptInfo& info = frameScripts[i];
@ -1854,13 +1846,12 @@ TabChild::CancelCachedFileDescriptorCallback(
}
void
TabChild::DoFakeShow(const ScrollingBehavior& aScrolling,
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
TabChild::DoFakeShow(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
const uint64_t& aLayersId,
PRenderFrameChild* aRenderFrame)
{
ShowInfo info(EmptyString(), false, false, 0, 0);
RecvShow(nsIntSize(0, 0), info, aScrolling, aTextureFactoryIdentifier,
RecvShow(nsIntSize(0, 0), info, aTextureFactoryIdentifier,
aLayersId, aRenderFrame, mParentIsActive);
mDidFakeShow = true;
}
@ -1960,7 +1951,6 @@ TabChild::MaybeRequestPreinitCamera()
bool
TabChild::RecvShow(const nsIntSize& aSize,
const ShowInfo& aInfo,
const ScrollingBehavior& aScrolling,
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
const uint64_t& aLayersId,
PRenderFrameChild* aRenderFrame,
@ -1980,7 +1970,7 @@ TabChild::RecvShow(const nsIntSize& aSize,
return false;
}
if (!InitRenderingState(aScrolling, aTextureFactoryIdentifier, aLayersId, aRenderFrame)) {
if (!InitRenderingState(aTextureFactoryIdentifier, aLayersId, aRenderFrame)) {
// We can fail to initialize our widget if the <browser
// remote> has already been destroyed, and we couldn't hook
// into the parent-process's layer system. That's not a fatal
@ -2177,7 +2167,7 @@ TabChild::RecvMouseWheelEvent(const WidgetWheelEvent& aEvent,
const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId)
{
if (IsAsyncPanZoomEnabled()) {
if (gfxPrefs::AsyncPanZoomEnabled()) {
nsCOMPtr<nsIDocument> document(GetDocument());
APZCCallbackHelper::SendSetTargetAPZCNotification(WebWidget(), document, aEvent, aGuid,
aInputBlockId, mSetTargetAPZCCallback);
@ -2187,7 +2177,7 @@ TabChild::RecvMouseWheelEvent(const WidgetWheelEvent& aEvent,
event.widget = mWidget;
APZCCallbackHelper::DispatchWidgetEvent(event);
if (IsAsyncPanZoomEnabled()) {
if (gfxPrefs::AsyncPanZoomEnabled()) {
mAPZEventState->ProcessWheelEvent(event, aGuid, aInputBlockId);
}
return true;
@ -2361,7 +2351,7 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
mWidget->GetDefaultScale(), GetPresShellResolution());
if (localEvent.message == NS_TOUCH_START && IsAsyncPanZoomEnabled()) {
if (localEvent.message == NS_TOUCH_START && gfxPrefs::AsyncPanZoomEnabled()) {
nsCOMPtr<nsIDocument> document = GetDocument();
APZCCallbackHelper::SendSetTargetAPZCNotification(WebWidget(), document,
localEvent, aGuid, aInputBlockId, mSetTargetAPZCCallback);
@ -2370,7 +2360,7 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
// Dispatch event to content (potentially a long-running operation)
nsEventStatus status = APZCCallbackHelper::DispatchWidgetEvent(localEvent);
if (!IsAsyncPanZoomEnabled()) {
if (!gfxPrefs::AsyncPanZoomEnabled()) {
UpdateTapState(localEvent, status);
return true;
}
@ -2793,8 +2783,7 @@ TabChild::InitTabChildGlobal(FrameScriptLoading aScriptLoading)
}
bool
TabChild::InitRenderingState(const ScrollingBehavior& aScrolling,
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
TabChild::InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
const uint64_t& aLayersId,
PRenderFrameChild* aRenderFrame)
{
@ -2807,7 +2796,6 @@ TabChild::InitRenderingState(const ScrollingBehavior& aScrolling,
}
MOZ_ASSERT(aLayersId != 0);
mScrolling = aScrolling;
mTextureFactoryIdentifier = aTextureFactoryIdentifier;
// Pushing layers transactions directly to a separate

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

@ -177,7 +177,6 @@ public:
virtual nsIWebNavigation* WebNavigation() const = 0;
virtual nsIWidget* WebWidget() = 0;
nsIPrincipal* GetPrincipal() { return mPrincipal; }
bool IsAsyncPanZoomEnabled();
// Recalculates the display state, including the CSS
// viewport. This should be called whenever we believe the
// viewport data on a document may have changed. If it didn't
@ -222,7 +221,6 @@ protected:
nsRefPtr<TabChildGlobal> mTabChildGlobal;
ScreenIntSize mInnerSize;
mozilla::layers::FrameMetrics mLastRootMetrics;
mozilla::layout::ScrollingBehavior mScrolling;
nsCOMPtr<nsIWebBrowserChrome3> mWebBrowserChrome;
};
@ -243,7 +241,6 @@ class TabChild MOZ_FINAL : public TabChildBase,
{
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
typedef mozilla::layout::RenderFrameChild RenderFrameChild;
typedef mozilla::layout::ScrollingBehavior ScrollingBehavior;
typedef mozilla::layers::APZEventState APZEventState;
typedef mozilla::layers::SetTargetAPZCCallback SetTargetAPZCCallback;
@ -313,7 +310,6 @@ public:
MOZ_OVERRIDE;
virtual bool RecvShow(const nsIntSize& aSize,
const ShowInfo& aInfo,
const ScrollingBehavior& aScrolling,
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
const uint64_t& aLayersId,
PRenderFrameChild* aRenderFrame,
@ -537,16 +533,14 @@ private:
enum FrameScriptLoading { DONT_LOAD_SCRIPTS, DEFAULT_LOAD_SCRIPTS };
bool InitTabChildGlobal(FrameScriptLoading aScriptLoading = DEFAULT_LOAD_SCRIPTS);
bool InitRenderingState(const ScrollingBehavior& aScrolling,
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
bool InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
const uint64_t& aLayersId,
PRenderFrameChild* aRenderFrame);
void DestroyWindow();
void SetProcessNameToAppName();
// Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
void DoFakeShow(const ScrollingBehavior& aScrolling,
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
void DoFakeShow(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
const uint64_t& aLayersId,
PRenderFrameChild* aRenderFrame);

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

@ -24,7 +24,6 @@ TabContext::TabContext()
: mInitialized(false)
, mOwnAppId(NO_APP_ID)
, mContainingAppId(NO_APP_ID)
, mScrollingBehavior(DEFAULT_SCROLLING)
, mIsBrowser(false)
{
}
@ -156,8 +155,7 @@ TabContext::SetTabContext(const TabContext& aContext)
bool
TabContext::SetTabContextForAppFrame(mozIApplication* aOwnApp,
mozIApplication* aAppFrameOwnerApp,
ScrollingBehavior aRequestedBehavior)
mozIApplication* aAppFrameOwnerApp)
{
NS_ENSURE_FALSE(mInitialized, false);
@ -181,15 +179,13 @@ TabContext::SetTabContextForAppFrame(mozIApplication* aOwnApp,
mIsBrowser = false;
mOwnAppId = ownAppId;
mContainingAppId = containingAppId;
mScrollingBehavior = aRequestedBehavior;
mOwnApp = aOwnApp;
mContainingApp = aAppFrameOwnerApp;
return true;
}
bool
TabContext::SetTabContextForBrowserFrame(mozIApplication* aBrowserFrameOwnerApp,
ScrollingBehavior aRequestedBehavior)
TabContext::SetTabContextForBrowserFrame(mozIApplication* aBrowserFrameOwnerApp)
{
NS_ENSURE_FALSE(mInitialized, false);
@ -204,18 +200,16 @@ TabContext::SetTabContextForBrowserFrame(mozIApplication* aBrowserFrameOwnerApp,
mIsBrowser = true;
mOwnAppId = NO_APP_ID;
mContainingAppId = containingAppId;
mScrollingBehavior = aRequestedBehavior;
mContainingApp = aBrowserFrameOwnerApp;
return true;
}
bool
TabContext::SetTabContextForNormalFrame(ScrollingBehavior aRequestedBehavior)
TabContext::SetTabContextForNormalFrame()
{
NS_ENSURE_FALSE(mInitialized, false);
mInitialized = true;
mScrollingBehavior = aRequestedBehavior;
return true;
}
@ -223,12 +217,10 @@ IPCTabContext
TabContext::AsIPCTabContext() const
{
if (mIsBrowser) {
return IPCTabContext(BrowserFrameIPCTabContext(mContainingAppId),
mScrollingBehavior);
return IPCTabContext(BrowserFrameIPCTabContext(mContainingAppId));
}
return IPCTabContext(AppFrameIPCTabContext(mOwnAppId, mContainingAppId),
mScrollingBehavior);
return IPCTabContext(AppFrameIPCTabContext(mOwnAppId, mContainingAppId));
}
static already_AddRefed<mozIApplication>
@ -342,12 +334,10 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
bool rv;
if (isBrowser) {
rv = mTabContext.SetTabContextForBrowserFrame(containingApp,
aParams.scrollingBehavior());
rv = mTabContext.SetTabContextForBrowserFrame(containingApp);
} else {
rv = mTabContext.SetTabContextForAppFrame(ownApp,
containingApp,
aParams.scrollingBehavior());
containingApp);
}
if (!rv) {

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

@ -7,7 +7,6 @@
#ifndef mozilla_dom_TabContext_h
#define mozilla_dom_TabContext_h
#include "mozilla/layout/RenderFrameUtils.h"
#include "mozIApplication.h"
#include "nsCOMPtr.h"
@ -30,9 +29,6 @@ class IPCTabContext;
*/
class TabContext
{
protected:
typedef mozilla::layout::ScrollingBehavior ScrollingBehavior;
public:
TabContext();
@ -106,11 +102,6 @@ public:
already_AddRefed<mozIApplication> GetOwnOrContainingApp() const;
bool HasOwnOrContainingApp() const;
/**
* Return the requested scrolling behavior for this frame.
*/
ScrollingBehavior GetScrollingBehavior() const { return mScrollingBehavior; }
protected:
friend class MaybeInvalidTabContext;
@ -133,20 +124,18 @@ protected:
* given app. Either or both apps may be null.
*/
bool SetTabContextForAppFrame(mozIApplication* aOwnApp,
mozIApplication* aAppFrameOwnerApp,
ScrollingBehavior aRequestedBehavior);
mozIApplication* aAppFrameOwnerApp);
/**
* Set this TabContext to be a browser frame inside the given app (which may
* be null).
*/
bool SetTabContextForBrowserFrame(mozIApplication* aBrowserFrameOwnerApp,
ScrollingBehavior aRequestedBehavior);
bool SetTabContextForBrowserFrame(mozIApplication* aBrowserFrameOwnerApp);
/**
* Set this TabContext to be a normal non-browser non-app frame.
*/
bool SetTabContextForNormalFrame(ScrollingBehavior aRequestedBehavior);
bool SetTabContextForNormalFrame();
private:
/**
@ -178,11 +167,6 @@ private:
*/
uint32_t mContainingAppId;
/**
* The requested scrolling behavior for this frame.
*/
ScrollingBehavior mScrollingBehavior;
/**
* Does this TabContext correspond to a browser element?
*
@ -204,23 +188,20 @@ public:
return TabContext::SetTabContext(aContext);
}
bool SetTabContextForAppFrame(mozIApplication* aOwnApp, mozIApplication* aAppFrameOwnerApp,
ScrollingBehavior aRequestedBehavior)
bool SetTabContextForAppFrame(mozIApplication* aOwnApp,
mozIApplication* aAppFrameOwnerApp)
{
return TabContext::SetTabContextForAppFrame(aOwnApp, aAppFrameOwnerApp,
aRequestedBehavior);
return TabContext::SetTabContextForAppFrame(aOwnApp, aAppFrameOwnerApp);
}
bool SetTabContextForBrowserFrame(mozIApplication* aBrowserFrameOwnerApp,
ScrollingBehavior aRequestedBehavior)
bool SetTabContextForBrowserFrame(mozIApplication* aBrowserFrameOwnerApp)
{
return TabContext::SetTabContextForBrowserFrame(aBrowserFrameOwnerApp,
aRequestedBehavior);
return TabContext::SetTabContextForBrowserFrame(aBrowserFrameOwnerApp);
}
bool SetTabContextForNormalFrame(ScrollingBehavior aRequestedBehavior)
bool SetTabContextForNormalFrame()
{
return TabContext::SetTabContextForNormalFrame(aRequestedBehavior);
return TabContext::SetTabContextForNormalFrame();
}
};

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

@ -805,7 +805,6 @@ TabParent::Show(const nsIntSize& size, bool aParentIsActive)
return;
}
ScrollingBehavior scrolling = UseAsyncPanZoom() ? ASYNC_PAN_ZOOM : DEFAULT_SCROLLING;
TextureFactoryIdentifier textureFactoryIdentifier;
uint64_t layersId = 0;
bool success = false;
@ -819,7 +818,6 @@ TabParent::Show(const nsIntSize& size, bool aParentIsActive)
if (frameLoader) {
renderFrame =
new RenderFrameParent(frameLoader,
scrolling,
&textureFactoryIdentifier,
&layersId,
&success);
@ -842,7 +840,7 @@ TabParent::Show(const nsIntSize& size, bool aParentIsActive)
info = ShowInfo(name, allowFullscreen, isPrivate, mDPI, mDefaultScale.scale);
}
unused << SendShow(size, info, scrolling, textureFactoryIdentifier,
unused << SendShow(size, info, textureFactoryIdentifier,
layersId, renderFrame, aParentIsActive);
}
@ -2334,14 +2332,12 @@ TabParent::AllocPRenderFrameParent()
{
MOZ_ASSERT(ManagedPRenderFrameParent().IsEmpty());
nsRefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
ScrollingBehavior scrolling = UseAsyncPanZoom() ? ASYNC_PAN_ZOOM : DEFAULT_SCROLLING;
TextureFactoryIdentifier textureFactoryIdentifier;
uint64_t layersId = 0;
bool success = false;
if(frameLoader) {
PRenderFrameParent* renderFrame =
new RenderFrameParent(frameLoader,
scrolling,
&textureFactoryIdentifier,
&layersId,
&success);
@ -2362,12 +2358,10 @@ TabParent::DeallocPRenderFrameParent(PRenderFrameParent* aFrame)
bool
TabParent::RecvGetRenderFrameInfo(PRenderFrameParent* aRenderFrame,
ScrollingBehavior* aScrolling,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
uint64_t* aLayersId)
{
RenderFrameParent* renderFrame = static_cast<RenderFrameParent*>(aRenderFrame);
*aScrolling = renderFrame->UseAsyncPanZoom() ? ASYNC_PAN_ZOOM : DEFAULT_SCROLLING;
renderFrame->GetTextureFactoryIdentifier(aTextureFactoryIdentifier);
*aLayersId = renderFrame->GetLayersId();
return true;
@ -2429,14 +2423,6 @@ TabParent::GetWidget() const
return widget.forget();
}
bool
TabParent::UseAsyncPanZoom()
{
bool usingOffMainThreadCompositing = !!CompositorParent::CompositorLoop();
return (usingOffMainThreadCompositing && gfxPrefs::AsyncPanZoomEnabled() &&
GetScrollingBehavior() == ASYNC_PAN_ZOOM);
}
void
TabParent::ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId)
@ -2618,7 +2604,7 @@ TabParent::InjectTouchEvent(const nsAString& aType,
NS_IMETHODIMP
TabParent::GetUseAsyncPanZoom(bool* useAsyncPanZoom)
{
*useAsyncPanZoom = UseAsyncPanZoom();
*useAsyncPanZoom = gfxPrefs::AsyncPanZoomEnabled();
return NS_OK;
}

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

@ -66,7 +66,6 @@ class TabParent : public PBrowserParent
, public TabContext
{
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
typedef mozilla::layout::ScrollingBehavior ScrollingBehavior;
virtual ~TabParent();
@ -400,7 +399,6 @@ protected:
virtual bool RecvRemotePaintIsReady() MOZ_OVERRIDE;
virtual bool RecvGetRenderFrameInfo(PRenderFrameParent* aRenderFrame,
ScrollingBehavior* aScrolling,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
uint64_t* aLayersId) MOZ_OVERRIDE;
@ -453,9 +451,6 @@ private:
CSSPoint AdjustTapToChildWidget(const CSSPoint& aPoint);
// When true, we create a pan/zoom controller for our frame and
// notify it of input events targeting us.
bool UseAsyncPanZoom();
// Update state prior to routing an APZ-aware event to the child process.
// |aOutTargetGuid| will contain the identifier
// of the APZC instance that handled the event. aOutTargetGuid may be

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

@ -212,10 +212,8 @@ ClientLayerManager::BeginTransactionWithTarget(gfxContext* aTarget)
// Desktop does not support async zoom yet, so we ignore this for those
// platforms.
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
if (mWidget) {
if (dom::TabChild* window = mWidget->GetOwningTabChild()) {
mCompositorMightResample = window->IsAsyncPanZoomEnabled();
}
if (mWidget && mWidget->GetOwningTabChild()) {
mCompositorMightResample = gfxPrefs::AsyncPanZoomEnabled();
}
#endif

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

@ -11132,10 +11132,10 @@ nsIPresShell::RecomputeFontSizeInflationEnabled()
// Force-enabling font inflation always trumps the heuristics here.
if (!FontSizeInflationForceEnabled()) {
if (TabChild* tab = TabChild::GetFrom(this)) {
if (TabChild::GetFrom(this)) {
// We're in a child process. Cancel inflation if we're not
// async-pan zoomed.
if (!tab->IsAsyncPanZoomEnabled()) {
if (!gfxPrefs::AsyncPanZoomEnabled()) {
mFontSizeInflationEnabled = false;
return;
}

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

@ -278,7 +278,6 @@ private:
};
RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader,
ScrollingBehavior aScrollingBehavior,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
uint64_t* aId,
bool* aSuccess)
@ -312,7 +311,7 @@ RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader,
static_cast<ClientLayerManager*>(lm.get());
clientManager->GetRemoteRenderer()->SendNotifyChildCreated(mLayersId);
}
if (aScrollingBehavior == ASYNC_PAN_ZOOM) {
if (gfxPrefs::AsyncPanZoomEnabled()) {
mContentController = new RemoteContentController(this);
CompositorParent::SetControllerForLayerTree(mLayersId, mContentController);
}

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

@ -14,7 +14,6 @@
#include "mozilla/layers/LayersTypes.h"
#include "mozilla/layout/PRenderFrameParent.h"
#include "nsDisplayList.h"
#include "RenderFrameUtils.h"
class nsFrameLoader;
class nsSubDocumentFrame;
@ -58,7 +57,6 @@ public:
* them to asynchronously pan and zoom.
*/
RenderFrameParent(nsFrameLoader* aFrameLoader,
ScrollingBehavior aScrollingBehavior,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
uint64_t* aId, bool* aSuccess);
virtual ~RenderFrameParent();
@ -96,8 +94,6 @@ public:
bool HitTest(const nsRect& aRect);
bool UseAsyncPanZoom() { return !!mContentController; }
void GetTextureFactoryIdentifier(TextureFactoryIdentifier* aTextureFactoryIdentifier);
inline uint64_t GetLayersId() { return mLayersId; }

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

@ -1,46 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=8 et :
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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_layer_RenderFrameUtils_h
#define mozilla_layer_RenderFrameUtils_h
#include "ipc/IPCMessageUtils.h"
namespace mozilla {
namespace layout {
enum ScrollingBehavior {
/**
* Use default scrolling behavior, which is synchronous: web content
* is reflowed and repainted for every scroll or zoom.
*/
DEFAULT_SCROLLING,
/**
* Use asynchronous panning and zooming, in which prerendered
* content can be translated and scaled independently of the thread
* painting content, without content reflowing or repainting.
*/
ASYNC_PAN_ZOOM,
SCROLLING_BEHAVIOR_SENTINEL
};
} // namespace layout
} // namespace mozilla
namespace IPC {
template <>
struct ParamTraits<mozilla::layout::ScrollingBehavior>
: public ContiguousEnumSerializer<
mozilla::layout::ScrollingBehavior,
mozilla::layout::DEFAULT_SCROLLING,
mozilla::layout::SCROLLING_BEHAVIOR_SENTINEL>
{};
} // namespace IPC
#endif // mozilla_layer_RenderFrameUtils_h

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

@ -7,7 +7,6 @@
EXPORTS.mozilla.layout += [
'RenderFrameChild.h',
'RenderFrameParent.h',
'RenderFrameUtils.h',
'VsyncChild.h',
'VsyncParent.h',
]