Merge pull request #1569 from shun-iwasawa/fix_plastic_tool_osx

Fix Vector Level Disappearing with Plastic Tool in OSX
This commit is contained in:
Jeremy Bullock 2017-11-15 23:49:10 -07:00 committed by GitHub
commit 7ce85485f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -270,8 +270,6 @@ TImageP ImageRasterizer::build(int imFlags, void *extData) {
TVectorRenderData rd(TTranslation(-off.x, -off.y), TRect(TPoint(0, 0), d),
vpalette, 0, true, true);
TGlContext oldContext = tglGetCurrentContext();
// this is too slow.
{
QSurfaceFormat format;
@ -279,12 +277,10 @@ TImageP ImageRasterizer::build(int imFlags, void *extData) {
std::unique_ptr<QOffscreenSurface> surface(new QOffscreenSurface());
surface->setFormat(format);
// Enabling Qt::AA_ShareOpenGLContexts attribute in main()
surface->setScreen(QOpenGLContext::globalShareContext()->screen());
surface->create();
std::unique_ptr<QOpenGLContext> context(new QOpenGLContext());
context->create();
context->makeCurrent(surface.get());
TRaster32P ras(d);
glPushAttrib(GL_ALL_ATTRIB_BITS);
@ -336,9 +332,6 @@ TImageP ImageRasterizer::build(int imFlags, void *extData) {
glPopAttrib();
context->doneCurrent();
tglMakeCurrent(oldContext);
TRasterImageP ri = TRasterImageP(ras);
ri->setOffset(off + ras->getCenter());