Skip to content

Commit

Permalink
Bug 1317637 - Use auto type specifier where aplicable for variable de…
Browse files Browse the repository at this point in the history
…clarations to improve code readability and maintainability in gfx/. r=jrmuizel

MozReview-Commit-ID: Dd6426wCbMg

--HG--
extra : rebase_source : 2bf01499dc6ac776004a098108e7ccb874968701
  • Loading branch information
abpostelnicu committed Nov 15, 2016
1 parent f93ddb3 commit f55eea3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gfx/2d/DrawTargetSkia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ DrawTargetSkia::FillGlyphsWithCG(ScaledFont *aFont,
}

// Calculate the area of the text we just drew
CGRect *bboxes = new CGRect[aBuffer.mNumGlyphs];
auto *bboxes = new CGRect[aBuffer.mNumGlyphs];
CTFontGetBoundingRectsForGlyphs(macFont->mCTFont, kCTFontDefaultOrientation,
glyphs.begin(), bboxes, aBuffer.mNumGlyphs);
CGRect extents = ComputeGlyphsExtents(bboxes, positions.begin(), aBuffer.mNumGlyphs, 1.0f);
Expand Down
2 changes: 1 addition & 1 deletion gfx/2d/MacIOSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ MacIOSurface::GetAsSurface() {
size_t ioHeight = GetDevicePixelHeight();

unsigned char* ioData = (unsigned char*)GetBaseAddress();
unsigned char* dataCpy =
auto *dataCpy =
new unsigned char[bytesPerRow * ioHeight / sizeof(unsigned char)];
for (size_t i = 0; i < ioHeight; i++) {
memcpy(dataCpy + i * bytesPerRow,
Expand Down
2 changes: 1 addition & 1 deletion gfx/gl/SkiaGLGlue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ glGetString_mozilla(GLContext* aContext, GrGLenum aName)

static GrGLInterface* CreateGrGLInterfaceFromGLContext(GLContext* context)
{
GrGLInterface* i = new GrGLInterface();
auto *i = new GrGLInterface();

context->MakeCurrent();

Expand Down
2 changes: 1 addition & 1 deletion gfx/layers/ImageContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ NVImage::GetAsSourceSurface()
// logics in PlanarYCbCrImage::GetAsSourceSurface().
const int bufferLength = mData.mYSize.height * mData.mYStride +
mData.mCbCrSize.height * mData.mCbCrSize.width * 2;
uint8_t* buffer = new uint8_t[bufferLength];
auto *buffer = new uint8_t[bufferLength];

Data aData = mData;
aData.mCbCrStride = aData.mCbCrSize.width;
Expand Down
4 changes: 2 additions & 2 deletions gfx/thebes/gfxPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget,
}

// Add user data to aSurface so we can cache lookups in the future.
SourceSurfaceUserData *srcSurfUD = new SourceSurfaceUserData;
auto *srcSurfUD = new SourceSurfaceUserData;
srcSurfUD->mBackendType = aTarget->GetBackendType();
srcSurfUD->mSrcSurface = srcBuffer;
aSurface->SetData(&kSourceSurface, srcSurfUD, SourceBufferDestroy);
Expand All @@ -1189,7 +1189,7 @@ gfxPlatform::GetWrappedDataSourceSurface(gfxASurface* aSurface)

// If we wrapped the underlying data of aSurface, then we need to add user data
// to make sure aSurface stays alive until we are done with the data.
DependentSourceSurfaceUserData *srcSurfUD = new DependentSourceSurfaceUserData;
auto *srcSurfUD = new DependentSourceSurfaceUserData;
srcSurfUD->mSurface = aSurface;
result->AddUserData(&kThebesSurface, srcSurfUD, SourceSurfaceDestroyed);

Expand Down

0 comments on commit f55eea3

Please sign in to comment.