Bug 1037100 - Remove all ScopedDeleteArray uses from gfx/gl/. r=jgilbert

--HG--
extra : rebase_source : fff244a14da1605f8c6db552925f5bc4b34fb106
This commit is contained in:
Jeff Walden 2014-07-10 17:43:01 -07:00
Родитель fa76238b4c
Коммит cdc3a731cf
4 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -849,9 +849,9 @@ public:
!data &&
Vendor() == GLVendor::NVIDIA)
{
ScopedDeleteArray<char> buf(new char[1]);
UniquePtr<char[]> buf = MakeUnique<char[]>(1);
buf[0] = 0;
fBufferSubData(target, size-1, 1, buf);
fBufferSubData(target, size-1, 1, buf.get());
}
}

Просмотреть файл

@ -3,6 +3,8 @@
* 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 "mozilla/UniquePtr.h"
#include "GLContext.h"
#include "ScopedGLHelpers.h"
@ -428,7 +430,7 @@ ScopedGLDrawState::ScopedGLDrawState(GLContext* aGL)
mGL->GetUIntegerv(LOCAL_GL_CURRENT_PROGRAM, &boundProgram);
mGL->GetUIntegerv(LOCAL_GL_ARRAY_BUFFER_BINDING, &boundBuffer);
mGL->GetUIntegerv(LOCAL_GL_MAX_VERTEX_ATTRIBS, &maxAttrib);
attrib_enabled = new GLint[maxAttrib];
attrib_enabled = MakeUnique<GLint[]>(maxAttrib);
for (unsigned int i = 0; i < maxAttrib; i++) {
mGL->fGetVertexAttribiv(i, LOCAL_GL_VERTEX_ATTRIB_ARRAY_ENABLED, &attrib_enabled[i]);

Просмотреть файл

@ -6,6 +6,8 @@
#ifndef SCOPEDGLHELPERS_H_
#define SCOPEDGLHELPERS_H_
#include "mozilla/UniquePtr.h"
#include "GLContext.h"
namespace mozilla {
@ -322,7 +324,7 @@ struct ScopedGLDrawState {
ScopedGLState stencil;
GLuint maxAttrib;
ScopedDeleteArray<GLint> attrib_enabled;
UniquePtr<GLint[]> attrib_enabled;
GLint attrib0_size;
GLint attrib0_stride;
GLint attrib0_type;

Просмотреть файл

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/Preferences.h"
#include "mozilla/UniquePtr.h"
#include "SharedSurfaceGralloc.h"
@ -221,7 +222,7 @@ SharedSurface_Gralloc::Fence()
// work. glReadPixels seems to, though.
if (gfxPrefs::GrallocFenceWithReadPixels()) {
mGL->MakeCurrent();
ScopedDeleteArray<char> buf(new char[4]);
UniquePtr<char[]> buf = MakeUnique<char>(4);
mGL->fReadPixels(0, 0, 1, 1, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE, buf);
}
}