[core] glPixelStorei is in OpenGL ES 2

This commit is contained in:
John Firebaugh
2017-06-07 15:46:16 -07:00
parent f5d3b850bf
commit b201a7900f
5 changed files with 47 additions and 52 deletions

View File

@@ -258,11 +258,9 @@ std::unique_ptr<uint8_t[]> Context::readFramebuffer(const Size size, const Textu
const size_t stride = size.width * (format == TextureFormat::RGBA ? 4 : 1);
auto data = std::make_unique<uint8_t[]>(stride * size.height);
#if not MBGL_USE_GLES2
// When reading data from the framebuffer, make sure that we are storing the values
// tightly packed into the buffer to avoid buffer overruns.
pixelStorePack = { 1 };
#endif // MBGL_USE_GLES2
MBGL_CHECK_ERROR(glReadPixels(0, 0, size.width, size.height, static_cast<GLenum>(format),
GL_UNSIGNED_BYTE, data.get()));
@@ -489,12 +487,12 @@ void Context::setDirtyState() {
program.setDirty();
lineWidth.setDirty();
activeTexture.setDirty();
pixelStorePack.setDirty();
pixelStoreUnpack.setDirty();
#if not MBGL_USE_GLES2
pointSize.setDirty();
pixelZoom.setDirty();
rasterPos.setDirty();
pixelStorePack.setDirty();
pixelStoreUnpack.setDirty();
pixelTransferDepth.setDirty();
pixelTransferStencil.setDirty();
#endif // MBGL_USE_GLES2