Bug 788319. Rename RenderToEGLSurface. r=kats

This commit is contained in:
Nicholas Cameron 2013-04-30 15:16:04 +12:00
parent 05710d2e22
commit 8bca207e89
5 changed files with 14 additions and 16 deletions

View File

@ -126,12 +126,12 @@ MessageLoop* CompositorParent::CompositorLoop()
}
CompositorParent::CompositorParent(nsIWidget* aWidget,
bool aRenderToEGLSurface,
bool aUseExternalSurfaceSize,
int aSurfaceWidth, int aSurfaceHeight)
: mWidget(aWidget)
, mCurrentCompositeTask(NULL)
, mPaused(false)
, mRenderToEGLSurface(aRenderToEGLSurface)
, mUseExternalSurfaceSize(aUseExternalSurfaceSize)
, mEGLSurfaceSize(aSurfaceWidth, aSurfaceHeight)
, mPauseCompositionMonitor("PauseCompositionMonitor")
, mResumeCompositionMonitor("ResumeCompositionMonitor")
@ -320,7 +320,7 @@ CompositorParent::ForceComposition()
void
CompositorParent::SetEGLSurfaceSize(int width, int height)
{
NS_ASSERTION(mRenderToEGLSurface, "Compositor created without RenderToEGLSurface provided");
NS_ASSERTION(mUseExternalSurfaceSize, "Compositor created without UseExternalSurfaceSize provided");
mEGLSurfaceSize.SizeTo(width, height);
if (mLayerManager) {
mLayerManager->GetCompositor()->SetDestinationSurfaceSize(gfx::IntSize(mEGLSurfaceSize.width, mEGLSurfaceSize.height));
@ -563,7 +563,7 @@ CompositorParent::AllocPLayerTransaction(const LayersBackend& aBackendHint,
new LayerManagerComposite(new CompositorOGL(mWidget,
mEGLSurfaceSize.width,
mEGLSurfaceSize.height,
mRenderToEGLSurface));
mUseExternalSurfaceSize));
mWidget = nullptr;
mLayerManager->SetCompositorID(mCompositorID);

View File

@ -44,7 +44,7 @@ class CompositorParent : public PCompositorParent,
public:
CompositorParent(nsIWidget* aWidget,
bool aRenderToEGLSurface = false,
bool aUseExternalSurfaceSize = false,
int aSurfaceWidth = -1, int aSurfaceHeight = -1);
virtual ~CompositorParent();
@ -239,7 +239,7 @@ private:
bool mPaused;
bool mRenderToEGLSurface;
bool mUseExternalSurfaceSize;
nsIntSize mEGLSurfaceSize;
mozilla::Monitor mPauseCompositionMonitor;

View File

@ -224,12 +224,12 @@ int ShaderProgramOGL::sCurrentProgramKey = 0;
#endif
CompositorOGL::CompositorOGL(nsIWidget *aWidget, int aSurfaceWidth,
int aSurfaceHeight, bool aIsRenderingToEGLSurface)
int aSurfaceHeight, bool aUseExternalSurfaceSize)
: mWidget(aWidget)
, mWidgetSize(-1, -1)
, mSurfaceSize(aSurfaceWidth, aSurfaceHeight)
, mHasBGRA(0)
, mIsRenderingToEGLSurface(aIsRenderingToEGLSurface)
, mUseExternalSurfaceSize(aUseExternalSurfaceSize)
, mFrameInProgress(false)
, mDestroyed(false)
{
@ -764,7 +764,7 @@ CompositorOGL::BeginFrame(const Rect *aClipRectIn, const gfxMatrix& aTransform,
mFrameInProgress = true;
gfxRect rect;
if (mIsRenderingToEGLSurface) {
if (mUseExternalSurfaceSize) {
rect = gfxRect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
} else {
rect = gfxRect(aRenderBounds.x, aRenderBounds.y, aRenderBounds.width, aRenderBounds.height);
@ -1209,7 +1209,7 @@ CompositorOGL::EndFrame()
#ifdef MOZ_DUMP_PAINTING
if (gfxUtils::sDumpPainting) {
nsIntRect rect;
if (mIsRenderingToEGLSurface) {
if (mUseExternalSurfaceSize) {
rect = nsIntRect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
} else {
mWidget->GetBounds(rect);
@ -1287,7 +1287,7 @@ void
CompositorOGL::CopyToTarget(gfxContext *aTarget, const gfxMatrix& aTransform)
{
nsIntRect rect;
if (mIsRenderingToEGLSurface) {
if (mUseExternalSurfaceSize) {
rect = nsIntRect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
} else {
rect = nsIntRect(0, 0, mWidgetSize.width, mWidgetSize.height);

View File

@ -29,7 +29,7 @@ class CompositorOGL : public Compositor
public:
CompositorOGL(nsIWidget *aWidget, int aSurfaceWidth = -1, int aSurfaceHeight = -1,
bool aIsRenderingToEGLSurface = false);
bool aUseExternalSurfaceSize = false);
virtual ~CompositorOGL();
@ -185,11 +185,11 @@ private:
bool mHasBGRA;
/**
* When rendering to an EGL surface (e.g. on Android), we rely on being told
* When rendering to some EGL surfaces (e.g. on Android), we rely on being told
* about size changes (via SetSurfaceSize) rather than pulling this information
* from the widget.
*/
bool mIsRenderingToEGLSurface;
bool mUseExternalSurfaceSize;
/**
* Have we had DrawQuad calls since the last frame was rendered?

View File

@ -864,8 +864,6 @@ nsBaseWidget::ComputeShouldAccelerate(bool aDefault)
CompositorParent* nsBaseWidget::NewCompositorParent(int aSurfaceWidth,
int aSurfaceHeight)
{
// Even if we are using EGL, unless we are on Android, we don't want
// CompositorParent to think we are, so we pass aRenderToEGLSurface = false.
return new CompositorParent(this, false, aSurfaceWidth, aSurfaceHeight);
}