Bug 782808 - Apply the widget rotation to the gonk LayerManager at all times instead of only during the paint event. r=cjones
This commit is contained in:
@@ -136,13 +136,16 @@ BasicLayerManager::~BasicLayerManager()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicLayerManager::SetDefaultTarget(gfxContext* aContext,
|
BasicLayerManager::SetDefaultTarget(gfxContext* aContext)
|
||||||
BufferMode aDoubleBuffering,
|
|
||||||
ScreenRotation aRotation)
|
|
||||||
{
|
{
|
||||||
NS_ASSERTION(!InTransaction(),
|
NS_ASSERTION(!InTransaction(),
|
||||||
"Must set default target outside transaction");
|
"Must set default target outside transaction");
|
||||||
mDefaultTarget = aContext;
|
mDefaultTarget = aContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BasicLayerManager::SetDefaultTargetConfiguration(BufferMode aDoubleBuffering, ScreenRotation aRotation)
|
||||||
|
{
|
||||||
mDoubleBuffering = aDoubleBuffering;
|
mDoubleBuffering = aDoubleBuffering;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -966,11 +969,9 @@ BasicShadowLayerManager::GetMaxTextureSize() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicShadowLayerManager::SetDefaultTarget(gfxContext* aContext,
|
BasicShadowLayerManager::SetDefaultTargetConfiguration(BufferMode aDoubleBuffering, ScreenRotation aRotation)
|
||||||
BufferMode aDoubleBuffering,
|
|
||||||
ScreenRotation aRotation)
|
|
||||||
{
|
{
|
||||||
BasicLayerManager::SetDefaultTarget(aContext, aDoubleBuffering, aRotation);
|
BasicLayerManager::SetDefaultTargetConfiguration(aDoubleBuffering, aRotation);
|
||||||
mTargetRotation = aRotation;
|
mTargetRotation = aRotation;
|
||||||
if (mWidget) {
|
if (mWidget) {
|
||||||
mTargetBounds = mWidget->GetNaturalBounds();
|
mTargetBounds = mWidget->GetNaturalBounds();
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ public:
|
|||||||
* mode we always completely overwrite the contents of aContext's
|
* mode we always completely overwrite the contents of aContext's
|
||||||
* destination surface (within the clip region) using OPERATOR_SOURCE.
|
* destination surface (within the clip region) using OPERATOR_SOURCE.
|
||||||
*/
|
*/
|
||||||
virtual void SetDefaultTarget(gfxContext* aContext, BufferMode aDoubleBuffering,
|
void SetDefaultTarget(gfxContext* aContext);
|
||||||
ScreenRotation aRotation);
|
virtual void SetDefaultTargetConfiguration(BufferMode aDoubleBuffering, ScreenRotation aRotation);
|
||||||
gfxContext* GetDefaultTarget() { return mDefaultTarget; }
|
gfxContext* GetDefaultTarget() { return mDefaultTarget; }
|
||||||
|
|
||||||
nsIWidget* GetRetainerWidget() { return mWidget; }
|
nsIWidget* GetRetainerWidget() { return mWidget; }
|
||||||
@@ -216,8 +216,7 @@ public:
|
|||||||
|
|
||||||
virtual PRInt32 GetMaxTextureSize() const;
|
virtual PRInt32 GetMaxTextureSize() const;
|
||||||
|
|
||||||
virtual void SetDefaultTarget(gfxContext* aContext, BufferMode aDoubleBuffering,
|
virtual void SetDefaultTargetConfiguration(BufferMode aDoubleBuffering, ScreenRotation aRotation) MOZ_OVERRIDE;
|
||||||
ScreenRotation aRotation) MOZ_OVERRIDE;
|
|
||||||
virtual void BeginTransactionWithTarget(gfxContext* aTarget);
|
virtual void BeginTransactionWithTarget(gfxContext* aTarget);
|
||||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
|
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
|
||||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||||
|
|||||||
@@ -522,10 +522,18 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
|
|||||||
{
|
{
|
||||||
if (aAllowRetaining)
|
if (aAllowRetaining)
|
||||||
*aAllowRetaining = true;
|
*aAllowRetaining = true;
|
||||||
if (mLayerManager)
|
if (mLayerManager) {
|
||||||
|
// This layer manager might be used for painting outside of DoDraw(), so we need
|
||||||
|
// to set the correct rotation on it.
|
||||||
|
if (mLayerManager->GetBackendType() == LAYERS_BASIC) {
|
||||||
|
BasicLayerManager* manager =
|
||||||
|
static_cast<BasicLayerManager*>(mLayerManager.get());
|
||||||
|
manager->SetDefaultTargetConfiguration(mozilla::layers::BUFFER_NONE,
|
||||||
|
ScreenRotation(EffectiveScreenRotation()));
|
||||||
|
}
|
||||||
return mLayerManager;
|
return mLayerManager;
|
||||||
|
}
|
||||||
|
|
||||||
LOG("Creating layer Manaer\n");
|
|
||||||
// Set mUseAcceleratedRendering here to make it consistent with
|
// Set mUseAcceleratedRendering here to make it consistent with
|
||||||
// nsBaseWidget::GetLayerManager
|
// nsBaseWidget::GetLayerManager
|
||||||
mUseAcceleratedRendering = GetShouldAccelerate();
|
mUseAcceleratedRendering = GetShouldAccelerate();
|
||||||
|
|||||||
@@ -739,7 +739,8 @@ nsBaseWidget::AutoLayerManagerSetup::AutoLayerManagerSetup(
|
|||||||
if (manager) {
|
if (manager) {
|
||||||
NS_ASSERTION(manager->GetBackendType() == LAYERS_BASIC,
|
NS_ASSERTION(manager->GetBackendType() == LAYERS_BASIC,
|
||||||
"AutoLayerManagerSetup instantiated for non-basic layer backend!");
|
"AutoLayerManagerSetup instantiated for non-basic layer backend!");
|
||||||
manager->SetDefaultTarget(aTarget, aDoubleBuffering, aRotation);
|
manager->SetDefaultTarget(aTarget);
|
||||||
|
manager->SetDefaultTargetConfiguration(aDoubleBuffering, aRotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -750,8 +751,8 @@ nsBaseWidget::AutoLayerManagerSetup::~AutoLayerManagerSetup()
|
|||||||
if (manager) {
|
if (manager) {
|
||||||
NS_ASSERTION(manager->GetBackendType() == LAYERS_BASIC,
|
NS_ASSERTION(manager->GetBackendType() == LAYERS_BASIC,
|
||||||
"AutoLayerManagerSetup instantiated for non-basic layer backend!");
|
"AutoLayerManagerSetup instantiated for non-basic layer backend!");
|
||||||
manager->SetDefaultTarget(nullptr, mozilla::layers::BUFFER_NONE,
|
manager->SetDefaultTarget(nullptr);
|
||||||
ROTATION_0);
|
manager->SetDefaultTargetConfiguration(mozilla::layers::BUFFER_NONE, ROTATION_0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user