本文整理汇总了C++中CompositorParent类的典型用法代码示例。如果您正苦于以下问题:C++ CompositorParent类的具体用法?C++ CompositorParent怎么用?C++ CompositorParent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CompositorParent类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: APZController
CompositorParent* MetroWidget::NewCompositorParent(int aSurfaceWidth, int aSurfaceHeight)
{
CompositorParent *compositor = nsBaseWidget::NewCompositorParent(aSurfaceWidth, aSurfaceHeight);
if (ShouldUseAPZC()) {
mRootLayerTreeId = compositor->RootLayerTreeId();
mController = new APZController();
mController->SetWidgetListener(mWidgetListener);
CompositorParent::SetControllerForLayerTree(mRootLayerTreeId, mController);
APZController::sAPZC = CompositorParent::GetAPZCTreeManager(compositor->RootLayerTreeId());
APZController::sAPZC->SetDPI(GetDPI());
nsresult rv;
nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1", &rv);
if (NS_SUCCEEDED(rv)) {
observerService->AddObserver(this, "apzc-scroll-offset-changed", false);
observerService->AddObserver(this, "Metro:ZoomToRect", false);
}
}
return compositor;
}
示例2: ScheduleComposition
bool ScheduleComposition(const T& op)
{
CompositableHost* comp = AsCompositable(op);
uint64_t id = comp->GetCompositorID();
if (!comp || !id) {
return false;
}
CompositorParent* cp = CompositorParent::GetCompositor(id);
if (!cp) {
return false;
}
cp->ScheduleComposition();
return true;
}
示例3: ScheduleComposition
bool ScheduleComposition(const T& op)
{
CompositableParent* comp = static_cast<CompositableParent*>(op.compositableParent());
if (!comp || !comp->GetCompositorID()) {
return false;
}
CompositorParent* cp
= CompositorParent::GetCompositor(comp->GetCompositorID());
if (!cp) {
return false;
}
cp->ScheduleComposition();
return true;
}
示例4: SharedImage
bool ImageContainerParent::RecvPublishImage(const SharedImage& aImage)
{
SharedImage *copy = new SharedImage(aImage);
SharedImage *prevImage = SwapSharedImage(mID, copy);
PRUint32 compositorID = GetCompositorIDForImage(mID);
CompositorParent* compositor = CompositorParent::GetCompositor(compositorID);
if (compositor) {
compositor->ScheduleComposition();
}
if (prevImage && !mStop) {
SendReturnImage(*prevImage);
delete prevImage;
}
return true;
}