Commit f826e1a3 by Geoff Lang

Avoid copy of PixelUnpackState in Texture::setImage.

The ternary operator determines that the common type is the value type, causing a copy of PixelUnpackState. If PixelUnpackState::pixelBuffer is non-null then there is an assertion failure in the destructor on any call to Texture::setImage. See:http://stackoverflow.com/a/30088030 BUG=angleproject:1149 Change-Id: I9654e65956339d6b6966ad65a98cf37ad4e00452 Reviewed-on: https://chromium-review.googlesource.com/297084Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent be184c7d
...@@ -211,8 +211,8 @@ Error Texture::setImage(Context *context, ...@@ -211,8 +211,8 @@ Error Texture::setImage(Context *context,
context->syncRendererState(context->getState().unpackStateBitMask()); context->syncRendererState(context->getState().unpackStateBitMask());
} }
const PixelUnpackState &unpack = const PixelUnpackState defaultUnpack;
context ? context->getState().getUnpackState() : PixelUnpackState(); const PixelUnpackState &unpack = context ? context->getState().getUnpackState() : defaultUnpack;
Error error = mTexture->setImage(target, level, internalFormat, size, format, type, unpack, pixels); Error error = mTexture->setImage(target, level, internalFormat, size, format, type, unpack, pixels);
if (error.isError()) if (error.isError())
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment