зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1006198 - Use 8byte aligned surface for CopyableCanvasLayer since that's the max WebGL supports for readback. r=nical
This commit is contained in:
Родитель
0dabff9cf3
Коммит
4fe1979c07
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче