Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix view rotation when rendering in background mode #1557

Merged
merged 10 commits into from
Sep 29, 2015

Conversation

sankhesh
Copy link
Contributor

Fixes #1446

@sankhesh
Copy link
Contributor Author

@doutriaux1 @aashish24

@doutriaux1
Copy link
Contributor

@sankhesh fails on mac?

@sankhesh
Copy link
Contributor Author

@doutriaux1

I think I know the issue. I'll push a fix soon.

@aashish24
Copy link
Contributor

Looks like mac is running into build issues 😢

@aashish24
Copy link
Contributor

CDMS_Test_multiple_formats because of opendap issue.

@doutriaux1
Copy link
Contributor

@sankhesh fails on RH6 w/o MESA

@doutriaux1
Copy link
Contributor

@aashish24 CDMS_Test_multiple_formats is weird it actually set faults on this machine. But it's not related to the regular .dodsrc open dap issue.

@durack1
Copy link
Member

durack1 commented Sep 23, 2015

@doutriaux1 it's vcs_test_background_mode_rotate on crunchy this time, and vcs_test_click_info on garant

@durack1
Copy link
Member

durack1 commented Sep 23, 2015

@doutriaux1 looks like Xvfb needs a restart on crunchy

Successfully updated your environment to use UVCDAT
(changes are valid for this session/terminal only)
Version: 2.2.0-538-g1922557
Location: /export/doutriaux1/uvcbot/build/install
failed to create drawable
X Error of failed request:  GLXBadContextTag
  Major opcode of failed request:  149 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  15662
  Current serial number in output stream:  15662)

@durack1
Copy link
Member

durack1 commented Sep 23, 2015

@doutriaux1 and the same weird issue with graphic output with fills outside of the box border and axis labels (particularly y-axis, see the location of the 90N) also being outside the area of the box - kinda like a box vs canvas offset or similar

The output of the test on garant:
displayimage php

@doutriaux1
Copy link
Contributor

@durack1 this is a new test. I can restart Xvfb but I doubt that's the issue

@@ -405,6 +408,12 @@ def portrait(self, W, H, x, y, clear):
else:
self.renWin.SetSize(W, H)

def portrait(self, W=-99, H=-99, x=-99, y=-99, clear=0):
self.resize_or_rotate_window(W, H, x, y, clear)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sankhesh this does not work the following snippet demonstrates the problem:

import cdms2
import vcs
import os
f=cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
s=f("clt")
x=vcs.init()
x.portrait()  # turn page in portrait mode
x.portrait()  # turn page in portrait mode (again but it is already in portrait so it should be doing nothing)
x.plot(s)
x.png("test_portrait_bg")

leads to:
test_portrait_bg

Essentially you rotate twice

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sankhesh you might want to add this as a test too if @aashish24 thinks it is a worthy test 😉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sankhesh I pushed a fix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sankhesh sorry there is still an issue somewhere:

import vcs
import cdms2
import os

f=cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
s=f("clt",slice(0,1))
x=vcs.init()
x.plot(s,bg=1)
x.png("landscape")
x.clear()
x.portrait()
x.plot(s,bg=1)
x.png("portrait")

comes out landscape

would return back to landscape
@durack1
Copy link
Member

durack1 commented Sep 24, 2015

@doutriaux1 looks like the vcs_addons_* test images might all be broken here?

@durack1 durack1 mentioned this pull request Sep 24, 2015
@sankhesh
Copy link
Contributor Author

@doutriaux1 @durack1 @aashish24 My latest changes fixed the background_rotate test that was added new in this branch.

@doutriaux1
Copy link
Contributor

@sankhesh does this fix the second script i posted last night

@sankhesh
Copy link
Contributor Author

@doutriaux1 Yes

@doutriaux1
Copy link
Contributor

@sankhesh your eztemplate png are actually better, can you please add them to the new baselines?

@sankhesh
Copy link
Contributor Author

@doutriaux1 What do you mean by _better_? All the EzTemplate tests pass on my machine i.e. they generate the same images as the baselines. What am I missing something here?

@aashish24
Copy link
Contributor

@jbeezley when I visit a link to garant in here, it does not show the page I am expected to see. Is that a bug?

@jbeezley
Copy link
Contributor

If the build stage doesn't finish, then the cdash link won't work. You need to look for the build manually. C.f. https://open.cdash.org/viewBuildError.php?buildid=4029068 It is one of the things that would be nice to have an API for in CDash.

@doutriaux1
Copy link
Contributor

@sankhesh on my Mac running your branch. The pngs are in portrait mode whereas it seems that the baselines png are in landscape. No?

@doutriaux1
Copy link
Contributor

@doutriaux1
Copy link
Contributor

@sankhesh could it be the bit that gets the screen size to determine the window size?

@aashish24
Copy link
Contributor

@doutriaux1 it does looks like that they are in different mode.

@doutriaux1
Copy link
Contributor

@sankhesh should we worry about crunchy failure? Maybe post rc1?

@sankhesh
Copy link
Contributor Author

@doutriaux1 Not sure why there is a GLX issue on crunchy just for this one test. Any ideas?

I am assuming you are referring to my EzTemplate question about the portrait vs landscape images. Yes, it does seem like your mac is generating portrait images. I think it is related to your latest screensize changes.

@doutriaux1
Copy link
Contributor

@sankhesh all platforms pass. Merging in.

doutriaux1 added a commit that referenced this pull request Sep 29, 2015
Fix view rotation when rendering in background mode
@doutriaux1 doutriaux1 merged commit a5d16ac into master Sep 29, 2015
@sankhesh sankhesh deleted the 1446_portrait_mode branch September 21, 2016 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants