/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* 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/. */ #include "mozilla/layers/ChromeProcessController.h" #include "mozilla/layers/CompositorParent.h" #include "mozilla/layers/APZCCallbackHelper.h" #include "nsLayoutUtils.h" using namespace mozilla; using namespace mozilla::layers; using namespace mozilla::widget; void ChromeProcessController::RequestContentRepaint(const FrameMetrics& aFrameMetrics) { MOZ_ASSERT(NS_IsMainThread()); if (aFrameMetrics.GetScrollId() == FrameMetrics::NULL_SCROLL_ID) { return; } nsCOMPtr targetContent = nsLayoutUtils::FindContentFor(aFrameMetrics.GetScrollId()); if (targetContent) { FrameMetrics metrics = aFrameMetrics; APZCCallbackHelper::UpdateSubFrame(targetContent, metrics); } } void ChromeProcessController::PostDelayedTask(Task* aTask, int aDelayMs) { MessageLoop::current()->PostDelayedTask(FROM_HERE, aTask, aDelayMs); } void ChromeProcessController::AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration) { APZCCallbackHelper::AcknowledgeScrollUpdate(aScrollId, aScrollGeneration); }