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
|
||||
BasicLayerManager::SetDefaultTarget(gfxContext* aContext,
|
||||
BufferMode aDoubleBuffering,
|
||||
ScreenRotation aRotation)
|
||||
BasicLayerManager::SetDefaultTarget(gfxContext* aContext)
|
||||
{
|
||||
NS_ASSERTION(!InTransaction(),
|
||||
"Must set default target outside transaction");
|
||||
mDefaultTarget = aContext;
|
||||
}
|
||||
|
||||
void
|
||||
BasicLayerManager::SetDefaultTargetConfiguration(BufferMode aDoubleBuffering, ScreenRotation aRotation)
|
||||
{
|
||||
mDoubleBuffering = aDoubleBuffering;
|
||||
}
|
||||
|
||||
@@ -966,11 +969,9 @@ BasicShadowLayerManager::GetMaxTextureSize() const
|
||||
}
|
||||
|
||||
void
|
||||
BasicShadowLayerManager::SetDefaultTarget(gfxContext* aContext,
|
||||
BufferMode aDoubleBuffering,
|
||||
ScreenRotation aRotation)
|
||||
BasicShadowLayerManager::SetDefaultTargetConfiguration(BufferMode aDoubleBuffering, ScreenRotation aRotation)
|
||||
{
|
||||
BasicLayerManager::SetDefaultTarget(aContext, aDoubleBuffering, aRotation);
|
||||
BasicLayerManager::SetDefaultTargetConfiguration(aDoubleBuffering, aRotation);
|
||||
mTargetRotation = aRotation;
|
||||
if (mWidget) {
|
||||
mTargetBounds = mWidget->GetNaturalBounds();
|
||||
|
||||
@@ -76,8 +76,8 @@ public:
|
||||
* mode we always completely overwrite the contents of aContext's
|
||||
* destination surface (within the clip region) using OPERATOR_SOURCE.
|
||||
*/
|
||||
virtual void SetDefaultTarget(gfxContext* aContext, BufferMode aDoubleBuffering,
|
||||
ScreenRotation aRotation);
|
||||
void SetDefaultTarget(gfxContext* aContext);
|
||||
virtual void SetDefaultTargetConfiguration(BufferMode aDoubleBuffering, ScreenRotation aRotation);
|
||||
gfxContext* GetDefaultTarget() { return mDefaultTarget; }
|
||||
|
||||
nsIWidget* GetRetainerWidget() { return mWidget; }
|
||||
@@ -216,8 +216,7 @@ public:
|
||||
|
||||
virtual PRInt32 GetMaxTextureSize() const;
|
||||
|
||||
virtual void SetDefaultTarget(gfxContext* aContext, BufferMode aDoubleBuffering,
|
||||
ScreenRotation aRotation) MOZ_OVERRIDE;
|
||||
virtual void SetDefaultTargetConfiguration(BufferMode aDoubleBuffering, ScreenRotation aRotation) MOZ_OVERRIDE;
|
||||
virtual void BeginTransactionWithTarget(gfxContext* aTarget);
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
|
||||
@@ -522,10 +522,18 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
|
||||
{
|
||||
if (aAllowRetaining)
|
||||
*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;
|
||||
}
|
||||
|
||||
LOG("Creating layer Manaer\n");
|
||||
// Set mUseAcceleratedRendering here to make it consistent with
|
||||
// nsBaseWidget::GetLayerManager
|
||||
mUseAcceleratedRendering = GetShouldAccelerate();
|
||||
|
||||
@@ -739,7 +739,8 @@ nsBaseWidget::AutoLayerManagerSetup::AutoLayerManagerSetup(
|
||||
if (manager) {
|
||||
NS_ASSERTION(manager->GetBackendType() == LAYERS_BASIC,
|
||||
"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) {
|
||||
NS_ASSERTION(manager->GetBackendType() == LAYERS_BASIC,
|
||||
"AutoLayerManagerSetup instantiated for non-basic layer backend!");
|
||||
manager->SetDefaultTarget(nullptr, mozilla::layers::BUFFER_NONE,
|
||||
ROTATION_0);
|
||||
manager->SetDefaultTarget(nullptr);
|
||||
manager->SetDefaultTargetConfiguration(mozilla::layers::BUFFER_NONE, ROTATION_0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user