Bug 1012407 - Part 8: Remove VBOArena which is now dead code (r=Bas)

This commit is contained in:
Andreas Gal 2014-05-28 14:04:07 -04:00
parent c9a7eecdef
commit 37ea7c31b8
6 changed files with 0 additions and 87 deletions

View File

@ -1,37 +0,0 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "VBOArena.h"
#include "GLContext.h"
using namespace mozilla::gl;
GLuint VBOArena::Allocate(GLContext *aGLContext)
{
if (!mAvailableVBOs.size()) {
GLuint vbo;
aGLContext->fGenBuffers(1, &vbo);
mAllocatedVBOs.push_back(vbo);
return vbo;
}
GLuint vbo = mAvailableVBOs.back();
mAvailableVBOs.pop_back();
return vbo;
}
void VBOArena::Reset()
{
mAvailableVBOs = mAllocatedVBOs;
}
void VBOArena::Flush(GLContext *aGLContext)
{
if (mAvailableVBOs.size()) {
#ifdef DEBUG
printf_stderr("VBOArena::Flush for %u VBOs\n", mAvailableVBOs.size());
#endif
aGLContext->fDeleteBuffers(mAvailableVBOs.size(), &mAvailableVBOs[0]);
}
}

View File

@ -1,35 +0,0 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef VBOARENA_H_
#define VBOARENA_H_
#include "GLTypes.h"
#include <vector>
namespace mozilla {
namespace gl {
class GLContext;
class VBOArena {
public:
// Allocate a new VBO.
GLuint Allocate(GLContext *aGLContext);
// Re-use previously allocated VBOs.
void Reset();
// Throw away all allocated VBOs.
void Flush(GLContext *aGLContext);
private:
std::vector<GLuint> mAllocatedVBOs;
std::vector<GLuint> mAvailableVBOs;
};
}
}
#endif

View File

@ -55,7 +55,6 @@ EXPORTS += [
'SurfaceStream.h',
'SurfaceTypes.h',
'TextureGarbageBin.h',
'VBOArena.h',
]
if CONFIG['MOZ_X11']:
@ -140,7 +139,6 @@ UNIFIED_SOURCES += [
'SurfaceTypes.cpp',
'TextureGarbageBin.cpp',
'TextureImageEGL.cpp',
'VBOArena.cpp',
]
FAIL_ON_WARNINGS = True

View File

@ -13,7 +13,6 @@
#include "mozilla/RefPtr.h" // for TemporaryRef, RefCounted
#include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration
#include "nsTArray.h" // for nsAutoTArray, nsTArray_Impl, etc
#include "VBOArena.h" // for gl::VBOArena
#include "prio.h" // for NSPR file i/o
namespace mozilla {

View File

@ -127,10 +127,6 @@ CompositorOGL::CreateContext()
void
CompositorOGL::Destroy()
{
if (gl() && gl()->MakeCurrent()) {
mVBOs.Flush(gl());
}
if (mTexturePool) {
mTexturePool->Clear();
mTexturePool = nullptr;
@ -683,8 +679,6 @@ CompositorOGL::BeginFrame(const nsIntRegion& aInvalidRegion,
LayerScope::BeginFrame(mGLContext, PR_Now());
mVBOs.Reset();
mFrameInProgress = true;
gfx::Rect rect;
if (mUseExternalSurfaceSize) {

View File

@ -31,7 +31,6 @@
#include "nsThreadUtils.h" // for nsRunnable
#include "nsXULAppAPI.h" // for XRE_GetProcessType
#include "nscore.h" // for NS_IMETHOD
#include "VBOArena.h" // for gl::VBOArena
#ifdef MOZ_WIDGET_GONK
#include <ui/GraphicBuffer.h>
#endif
@ -302,11 +301,6 @@ private:
*/
GLuint mQuadVBO;
/**
* When we can't use mQuadVBO, we allocate VBOs from this arena instead.
*/
gl::VBOArena mVBOs;
bool mHasBGRA;
/**