b=561168; convert canvas to use layers for rendering - followup; r=roc

This commit is contained in:
Vladimir Vukicevic
2010-05-17 21:04:22 -07:00
parent f105732465
commit fce8c7c47d
4 changed files with 30 additions and 4 deletions

View File

@@ -73,6 +73,7 @@ CanvasLayerOGL::Initialize(const Data& aData)
mSurface = aData.mSurface;
NS_ASSERTION(aData.mGLContext == nsnull,
"CanvasLayerOGL can't have both surface and GLContext");
mNeedsYFlip = PR_TRUE;
} else if (aData.mGLContext) {
// this must be a pbuffer context
void *pbuffer = aData.mGLContext->GetNativeData(GLContext::NativePBuffer);
@@ -83,6 +84,7 @@ CanvasLayerOGL::Initialize(const Data& aData)
mGLContext = aData.mGLContext;
mGLBufferIsPremultiplied = aData.mGLBufferIsPremultiplied;
mNeedsYFlip = PR_FALSE;
} else {
NS_WARNING("CanvasLayerOGL::Initialize called without surface or GL context!");
return;
@@ -213,6 +215,10 @@ CanvasLayerOGL::RenderLayer(int aPreviousDestination)
// XXX We're going to need a different program depending on if
// mGLBufferIsPremultiplied is TRUE or not. The RGBLayerProgram
// assumes that it's true.
// XXX this function needs to handle both mNeedsYFlip -- right now,
// as written, PBuffer canvas layers will be drawn upside-down.
RGBLayerProgram *program = glManager->GetRGBLayerProgram();
program->Activate();