Skip to content

Commit

Permalink
Removed obsolete API
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeshkova committed Oct 14, 2014
1 parent d290f96 commit 4acac37
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 101 deletions.
7 changes: 0 additions & 7 deletions embedding/embedlite/EmbedLiteView.cpp
Expand Up @@ -390,13 +390,6 @@ EmbedLiteView::GetUniqueID()
return mUniqueID;
}

bool
EmbedLiteView::GetPendingTexture(EmbedLiteRenderTarget* aContextWrapper, int* textureID, int* width, int* height, int* textureTarget)
{
NS_ENSURE_TRUE(mViewImpl, false);
return NS_SUCCEEDED(mViewImpl->GetPendingTexture(aContextWrapper, textureID, width, height, textureTarget));
}

void*
EmbedLiteView::GetPlatformImage(int* width, int* height)
{
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/EmbedLiteView.h
Expand Up @@ -130,7 +130,6 @@ class EmbedLiteView
virtual void SendAsyncMessage(const char16_t* aMessageName, const char16_t* aMessage);

virtual uint32_t GetUniqueID();
virtual bool GetPendingTexture(EmbedLiteRenderTarget* aContextWrapper, int* textureID, int* width, int* height, int* textureTarget = 0);
virtual void* GetPlatformImage(int* width, int* height);

virtual void SuspendRendering();
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/embedhelpers/EmbedLiteViewIface.idl
Expand Up @@ -58,7 +58,6 @@ interface EmbedLiteViewIface
void UpdateScrollController();
void ViewAPIDestroyed();
void GetUniqueID(out uint32_t aId);
void GetPendingTexture(in EmbedLiteRenderTarget aContextWrapper, out int32_t aTextureID, out int32_t aTextureTarget, out int32_t aWidth, out int32_t aHeight);
void GetPlatformImage(out PlatformImage aImage, out int32_t aWidth, out int32_t aHeight);
void SuspendRendering();
void ResumeRendering();
Expand Down
92 changes: 0 additions & 92 deletions embedding/embedlite/embedthread/EmbedLiteViewThreadParent.cpp
Expand Up @@ -15,24 +15,6 @@
#include "mozilla/unused.h"
#include "EmbedContentController.h"
#include "mozilla/layers/APZCTreeManager.h"
#include "EmbedLiteRenderTarget.h"

//#include "GLContext.h" // for GLContext
#include "GLScreenBuffer.h" // for GLScreenBuffer
#include "SharedSurfaceEGL.h" // for SurfaceFactory_EGLImage
#include "SharedSurfaceGL.h" // for SurfaceFactory_GLTexture, etc
#include "SurfaceTypes.h" // for SurfaceStreamType
#include "ClientLayerManager.h" // for ClientLayerManager, etc
#include "GLUploadHelpers.h"
#include "gfxPlatform.h"

#include "BasicLayers.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "mozilla/layers/AsyncCompositionManager.h"
#include "mozilla/layers/LayerTransactionParent.h"
#include "mozilla/layers/CompositorOGL.h"
#include "gfxUtils.h"


using namespace mozilla::gfx;
using namespace mozilla::gl;
Expand Down Expand Up @@ -754,80 +736,6 @@ EmbedLiteViewThreadParent::GetUniqueID(uint32_t *aId)
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteViewThreadParent::GetPendingTexture(EmbedLiteRenderTarget* aContextWrapper, int* textureID, int* width, int* height, int* aTextureTarget)
{
NS_ENSURE_TRUE(aContextWrapper && textureID && width && height, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(mCompositor, NS_ERROR_FAILURE);

const CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(mCompositor->RootLayerTreeId());
NS_ENSURE_TRUE(state && state->mLayerManager, NS_ERROR_FAILURE);

GLContext* context = static_cast<CompositorOGL*>(state->mLayerManager->GetCompositor())->gl();
NS_ENSURE_TRUE(context && context->IsOffscreen(), NS_ERROR_FAILURE);

GLContext* consumerContext = aContextWrapper->GetConsumerContext();
NS_ENSURE_TRUE(consumerContext && consumerContext->Init(), NS_ERROR_FAILURE);

GLScreenBuffer* screen = context->Screen();
MOZ_ASSERT(screen);
SharedSurface* sharedSurf = screen->Front()->Surf();
NS_ENSURE_TRUE(sharedSurf, NS_ERROR_FAILURE);
sharedSurf->WaitSync();

DataSourceSurface* toUpload = nullptr;
GLuint textureHandle = 0;
GLuint textureTarget = 0;
if (sharedSurf->mType == SharedSurfaceType::EGLImageShare) {
SharedSurface_EGLImage* eglImageSurf = SharedSurface_EGLImage::Cast(sharedSurf);
eglImageSurf->AcquireConsumerTexture(consumerContext, &textureHandle, &textureTarget);
if (!textureHandle) {
NS_WARNING("Failed to get texture handle, fallback to pixels?");
}
} else if (sharedSurf->mType == SharedSurfaceType::GLTextureShare) {
SharedSurface_GLTexture* glTexSurf = SharedSurface_GLTexture::Cast(sharedSurf);
textureHandle = glTexSurf->ConsTexture(consumerContext);
textureTarget = glTexSurf->ConsTextureTarget();
NS_ASSERTION(textureHandle, "Failed to get texture handle, fallback to pixels?");
} else if (sharedSurf->mType == SharedSurfaceType::Basic) {
toUpload = SharedSurface_Basic::Cast(sharedSurf)->GetData();
} else {
NS_ERROR("Unhandled Image type");
}

if (toUpload) {
// mBounds seems to end up as (0,0,0,0) a lot, so don't use it?
nsIntSize size(ThebesIntSize(toUpload->GetSize()));
nsIntRect rect(nsIntPoint(0,0), size);
nsIntRegion bounds(rect);
UploadSurfaceToTexture(consumerContext,
toUpload,
bounds,
mUploadTexture,
true);
textureHandle = mUploadTexture;
textureTarget = LOCAL_GL_TEXTURE_2D;
} else if (textureHandle) {
if (consumerContext) {
MOZ_ASSERT(consumerContext);
if (consumerContext->MakeCurrent()) {
consumerContext->fDeleteTextures(1, &mUploadTexture);
}
}
}

NS_ASSERTION(textureHandle, "Failed to get texture handle from EGLImage, fallback to pixels?");

*width = sharedSurf->mSize.width;
*height = sharedSurf->mSize.height;
*textureID = textureHandle;
if (aTextureTarget) {
*aTextureTarget = textureTarget;
}

return NS_OK;
}

NS_IMETHODIMP
EmbedLiteViewThreadParent::GetPlatformImage(void* *aImage, int* width, int* height)
{
Expand Down

0 comments on commit 4acac37

Please sign in to comment.