mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-25 01:01:52 +00:00
Bug 1006198 - Use 8byte aligned surface for CopyableCanvasLayer since that's the max WebGL supports for readback. r=nical
This commit is contained in:
parent
c58e00be05
commit
e9d5f989f3
@ -17,6 +17,7 @@
|
||||
#include "gfxUtils.h" // for gfxUtils
|
||||
#include "gfx2DGlue.h" // for thebes --> moz2d transition
|
||||
#include "mozilla/gfx/BaseSize.h" // for BaseSize
|
||||
#include "mozilla/gfx/Tools.h"
|
||||
#include "nsDebug.h" // for NS_ASSERTION, NS_WARNING, etc
|
||||
#include "nsISupportsImpl.h" // for gfxContext::AddRef, etc
|
||||
#include "nsRect.h" // for nsIntRect
|
||||
@ -170,7 +171,9 @@ CopyableCanvasLayer::GetTempSurface(const IntSize& aSize,
|
||||
aSize != mCachedTempSurface->GetSize() ||
|
||||
aFormat != mCachedTempSurface->GetFormat())
|
||||
{
|
||||
mCachedTempSurface = Factory::CreateDataSourceSurface(aSize, aFormat);
|
||||
// Create a surface aligned to 8 bytes since that's the highest alignment WebGL can handle.
|
||||
uint32_t stride = GetAlignedStride<8>(aSize.width * BytesPerPixel(aFormat));
|
||||
mCachedTempSurface = Factory::CreateDataSourceSurfaceWithStride(aSize, aFormat, stride);
|
||||
}
|
||||
|
||||
return mCachedTempSurface;
|
||||
|
Loading…
Reference in New Issue
Block a user