Skip to main content
Jump to: navigation, search

Difference between revisions of "Bug 421383 - Graphics Scaling issues on high DPI displays"

(New Api changes)
Line 14: Line 14:
  
 
The image data is held through NSimage in Cocoa, Image handle in Windows, pixmap resource in GTK+2 and Cairo surface for GTK+3.
 
The image data is held through NSimage in Cocoa, Image handle in Windows, pixmap resource in GTK+2 and Cairo surface for GTK+3.
Now this particular structure needs to modified to hold multiple entries to these along with their size. Preferable datastructure Map
+
Now this particular structure needs to modified to hold multiple entries. so these will be held in an array so that these image representations could be held. Currently we are planning for images for 3 dpi values 100%, 150% and 200%
 +
The image selection will be according to the following table. This calculated based on the 100% correspond to 96 in Windows and Linux and 72 for Mac <ref>{{url=http://en.wikipedia.org/wiki/Dots_per_inch#Computer_monitor_DPI_standards}}
 +
{| class="wikitable" style="text-align:center;"
 +
|-
 +
!width=130| ||width=120|Icon Size|| width=120|Windows || width=120|Linux(GTK) || width=120|Mac
 +
|-
 +
|align=left| 100% || 16X16 || 0-143 || 0-143 || 0-107
 +
|-
 +
|align=left| 150% || 24X24 || 144-191 || 144-191 || 108-143
 +
|-
 +
|align=left| 200% || 32X32 || >191 || >191 || >144
 +
|}
 +
 
  
 
'''Image(Device, String filename)''' constructer will be modified to search for all images in that location and add to Image data list. here is the example on how this works.
 
'''Image(Device, String filename)''' constructer will be modified to search for all images in that location and add to Image data list. here is the example on how this works.
if the file name provided is /home/eclipse/plugins/images/eclipse_icon.png. This constructor will look for files /home/eclipse/plugins/images/eclipse_icon.png and /home/eclipse/plugins/images/eclipse_icon@*x.png. This way it can get the file names eclipse_icon.png, eclipse_icon_2x.png etc. These will be added to Image data list.
+
if the file name provided is /home/eclipse/plugins/images/eclipse_icon.png. This constructor will look for files /home/eclipse/plugins/images/eclipse_icon.png and /home/eclipse/plugins/images/eclipse_icon@*x.png. This way it can get the file names eclipse_icon.png, eclipse_icon_2x.png etc. These will be added to Image data list. '''Assumption:''' The image file name passed is assumed to be at 100% zoom level.
  
 
A new constructor
 
A new constructor
  
'''Image(Device, List filenames)''' will be provided so that user can provide the image names in a list. but I am assuming this may not be used that much.
+
'''Image(Device, String[] filenames)''' will be provided so that user can provide the image names in a list. but I am assuming this may not be used that much. here the the images are in the order of 100%,150% and 200%.
  
 
a new set of apis will be will be provided.
 
a new set of apis will be will be provided.
  
'''Image.addRepresentation(Image)'''
+
'''Image.addRepresentation(Image, int zoomLevel)'''-The zoom level will be defaulted to 100%
'''Image.addRepresentation(ImageData)'''
+
'''Image.addRepresentation(ImageData, int zoomLevel)''' -The zoom level will be defaulted to 100%
'''Image.addRepresentation(InputStream)'''
+
'''Image.addRepresentation(InputStream, int zoomLevel)'''-The zoom level will be defaulted to 100%
'''Image.addRepresentation(Filename)'''  - this case we will not search for multiple entries(multiple image search is provide only through constructor)
+
'''Image.addRepresentation(Filename, int zoomLevel)'''  - this case we will not search for multiple entries(multiple image search is provide only through constructor)
'''Image.getImageData()''' - will return the Image data for the first Image. in case of Icons it will be 16X16.
+
'''Image.getImageData()''' - will return the Image data for the zoom level 100%. in case of Icons it will be 16X16.
 +
'''Image.getImageData(int zoomLevel)''' - will return Imagedata specified for zoomLevel if found else null. Null check is required.
 +
'''Image.getDefaultImageData()''' - will return the Image data for the monitor currenlty selected(based on the dpi of the monitor).
  
'''Image.getImageData(int size)''' - will return Imagedata specified for sizeXsize if found else null. Null check is required.
 
 
 
== Assumptions ==
 
== Assumptions ==
  
 
1.    Multiple images are used to represent the icons only and they will not be used for other images like splash screen etc.
 
1.    Multiple images are used to represent the icons only and they will not be used for other images like splash screen etc.

Revision as of 06:30, 19 December 2014

Capture the the design discussion for the Bug 421383

New Api changes

The following api needs to modified

Point Device.getDpi() - This api is currently used by printing functionality this will be extended to displays so that it return pixels per inch in each direction. this will be added to Monitor class as well.

Additional changes in Monitor class a new attribute Point dpi will be added to Monitor class and getDPI() will return this attribute. this will be calculated per Monitor and held in this object


Image class modifications.

The image data is held through NSimage in Cocoa, Image handle in Windows, pixmap resource in GTK+2 and Cairo surface for GTK+3. Now this particular structure needs to modified to hold multiple entries. so these will be held in an array so that these image representations could be held. Currently we are planning for images for 3 dpi values 100%, 150% and 200% The image selection will be according to the following table. This calculated based on the 100% correspond to 96 in Windows and Linux and 72 for Mac [1]
Cite error: <ref> tags exist, but no <references/> tag was found

Back to the top