Scaling cleanup: Difference between revisions

From vice-emu
Jump to navigation Jump to search
(Created page with "# first the optimal size of the canvas is calculated # then, the window is created of the right size # NO resize message is sent to the window at startup, since the window is...")
 
mNo edit summary
Line 1: Line 1:
== Status ==
generally the strategy for creating the initial window should be like this (in all ports):
# first the optimal size of the canvas is calculated
# first the optimal size of the canvas is calculated
# then, the window is created of the right size
# then, the window is created of the right size
# NO resize message is sent to the window at startup, since the window  
# NO resize message is sent to the window at startup, since the window is already of the right size.  
is already of the right size. Instead, a resize message is sent to the  
## Instead, a resize message is sent to the window only when there's a user action such as enabling double-size, dragging window edges etc
window when there's a user action such as enable scale 2x.
 
ports that work like this: SDL
ports that do NOT work like this (yet): Xaw, GTK
 
'''TODO:''' check amiga, beos, dos, os/2, osx, win32


Right now 3 sizing models are supported
Right now 3 sizing models are supported
# the canvas size is calculated, then the window fits the canvas. Used  
# the canvas size is calculated, then the window fits the canvas. Used by most ports when HW scaling is off
by most ports when HW scaling is off
# the canvas size is calculated, the window has an arbitrary width and height, the image is streched/squeezed. Used by most ports when HW scaling is on
# the canvas size is calculated, the window has an arbitrary width and  
## the canvas size is calculated, the window's aspect ratio fits the canvas', the window has an arbitrary width '''or''' height
height, the image is streched/squeezed. Used by most ports when HW  
# the canvas size is calculated, the window has an arbitrary width and height, a black border is added to the image if the window is too big or the image is cropped smartly if the window is too small. Used by Xaw
scaling is on
 
## the canvas size is calculated, the window's aspect ratio fits the  
'''TODO:''' List here what ports use which model
canvas', the window has an arbitrary width or height
'''TODO:''' The third one is really ugly (and it is the only reason why we have the unnecessary complication of video-viewport) and should be removed
# the canvas size is calculated, the window has an arbitrary width and  
height, a black border is added to the image if the window is too big or  
the image is cropped smartly if the window is too small. Used by Xaw  
(and in the past by more ports)


Do we really need all 3? The third one is really ugly (and it is the
== Todo ==
only reason why we have the unnecessary complication of video-viewport).


* first fix the Xaw port to not use the above mentioned 3rd sizing model
** document the needed changes here incase other ports have to be fixed
* fix strategy for creating the initial window as mentioned above for Xaw
** document needed changes here
* fix the remaining ports
* remove the now unnecessary stuff in video-viewport (remove the above mentioned 3rd sizing model)


----
----


List of ports: amiga, beos, dos, os/2, osx, *nix, win32, sdl
List of ports: amiga, beos, dos, os/2, osx, xaw, gtk, win32, sdl

Revision as of 16:13, 29 November 2012

Status

generally the strategy for creating the initial window should be like this (in all ports):

  1. first the optimal size of the canvas is calculated
  2. then, the window is created of the right size
  3. NO resize message is sent to the window at startup, since the window is already of the right size.
    1. Instead, a resize message is sent to the window only when there's a user action such as enabling double-size, dragging window edges etc

ports that work like this: SDL ports that do NOT work like this (yet): Xaw, GTK

TODO: check amiga, beos, dos, os/2, osx, win32

Right now 3 sizing models are supported

  1. the canvas size is calculated, then the window fits the canvas. Used by most ports when HW scaling is off
  2. the canvas size is calculated, the window has an arbitrary width and height, the image is streched/squeezed. Used by most ports when HW scaling is on
    1. the canvas size is calculated, the window's aspect ratio fits the canvas', the window has an arbitrary width or height
  3. the canvas size is calculated, the window has an arbitrary width and height, a black border is added to the image if the window is too big or the image is cropped smartly if the window is too small. Used by Xaw

TODO: List here what ports use which model TODO: The third one is really ugly (and it is the only reason why we have the unnecessary complication of video-viewport) and should be removed

Todo

  • first fix the Xaw port to not use the above mentioned 3rd sizing model
    • document the needed changes here incase other ports have to be fixed
  • fix strategy for creating the initial window as mentioned above for Xaw
    • document needed changes here
  • fix the remaining ports
  • remove the now unnecessary stuff in video-viewport (remove the above mentioned 3rd sizing model)

List of ports: amiga, beos, dos, os/2, osx, xaw, gtk, win32, sdl