Skip to content

Commit

Permalink
Fix compositor to build
Browse files Browse the repository at this point in the history
  • Loading branch information
rainemak committed Dec 19, 2016
1 parent d05cd01 commit 47391db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions embedding/embedlite/embedthread/EmbedLiteCompositorParent.cpp
Expand Up @@ -25,6 +25,7 @@
#include "SharedSurfaceEGL.h" // for SurfaceFactory_EGLImage
#include "SharedSurfaceGL.h" // for SurfaceFactory_GLTexture, etc
#include "SurfaceTypes.h" // for SurfaceStreamType
#include "TextureClientSharedSurface.h" // for SharedSurfaceTextureClient
#include "ClientLayerManager.h" // for ClientLayerManager, etc

using namespace mozilla::layers;
Expand Down Expand Up @@ -99,7 +100,16 @@ EmbedLiteCompositorParent::PrepareOffscreen()
UniquePtr<SurfaceFactory> factory;
if (context->GetContextType() == GLContextType::EGL) {
// [Basic/OGL Layers, OMTC] WebGL layer init.
factory = SurfaceFactory_EGLImage::Create(context, screen->mCaps);
auto forwarder = state->mLayerManager->AsShadowForwarder();

layers::TextureFlags flags = layers::TextureFlags::ORIGIN_BOTTOM_LEFT;

printf("=============== caps.premultAlpha: %d ptr: %p\n", screen->mCaps.premultAlpha, forwarder);

if (!caps.premultAlpha) {
flags |= layers::TextureFlags::NON_PREMULTIPLIED;
}
factory = SurfaceFactory_EGLImage::Create(context, screen->mCaps, forwarder, flags);
} else {
// [Basic Layers, OMTC] WebGL layer init.
// Well, this *should* work...
Expand Down Expand Up @@ -156,7 +166,7 @@ EmbedLiteCompositorParent::Invalidate()

bool EmbedLiteCompositorParent::RenderGL(TimeStamp aScheduleTime)
{
mLastCompose = aScheduleTime;
// mLastCompose = aScheduleTime;
if (mCurrentCompositeTask) {
mCurrentCompositeTask->Cancel();
mCurrentCompositeTask = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions gfx/layers/ipc/CompositorParent.h
Expand Up @@ -182,8 +182,8 @@ class CompositorUpdateObserver
virtual ~CompositorUpdateObserver() {}
};

class CompositorParent final : public PCompositorParent,
public ShadowLayersManager
class CompositorParent : public PCompositorParent,
public ShadowLayersManager
{
NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(CompositorParent)
friend class CompositorVsyncScheduler;
Expand Down

0 comments on commit 47391db

Please sign in to comment.