Bug 1144012 - Part 4: Remove the usage of mHwc from GonkDisplayICS. r=sotaro

This commit is contained in:
Boris Chiou 2015-06-23 15:06:00 +02:00
parent 1940eaaf97
commit 785d7bcf18
2 changed files with 10 additions and 10 deletions

View File

@ -715,6 +715,7 @@ HwcComposer2D::Render(nsIWidget* aWidget)
if (!mHal->HasHwc() || !mList) {
return GetGonkDisplay()->SwapBuffers(screen->GetDpy(), screen->GetSur());
} else if (!mList && !ReallocLayerList()) {
LOGE("Cannot realloc layer list");
return false;
}
@ -811,15 +812,21 @@ bool
HwcComposer2D::TryHwComposition(nsScreenGonk* aScreen)
{
mHal->SetEGLInfo(aScreen->GetDpy(), aScreen->GetSur());
return !mHal->Set(mList, GonkDisplay::DISPLAY_PRIMARY);
return !mHal->Set(mList, aScreen->GetDisplayType());
}
bool
HwcComposer2D::Render(nsIWidget* aWidget)
{
nsScreenGonk* screen = static_cast<nsWindow*>(aWidget)->GetScreen();
GetGonkDisplay()->SwapBuffers(screen->GetDpy(), screen->GetSur());
return GetGonkDisplay()->SwapBuffers(screen->GetDpy(), screen->GetSur());
if (!mHal->HasHwc()) {
return true;
}
mHal->Prepare(nullptr, screen->GetDisplayType(), nullptr, -1);
return !mHal->Set(nullptr, screen->GetDisplayType());
}
#endif

View File

@ -168,14 +168,7 @@ GonkDisplayICS::SwapBuffers(EGLDisplay dpy, EGLSurface sur)
{
// Should be called when composition rendering is complete for a frame.
// Only HWC v1.0 needs this call. ICS gonk always needs the call.
mFBSurface->compositionComplete();
if (!mHwc) {
return true;
}
mHwc->prepare(mHwc, nullptr);
return !mHwc->set(mHwc, dpy, sur, 0);
return !mFBSurface->compositionComplete();
}
ANativeWindowBuffer*