Descriptiongfx: Converge scale precision related differences to single class.
Different scale factors which are almost equal (i.e. differ by some
threshold magnitude of floating point epsilon) create different
tilings when content is rigourously zoomed.
e.g. If scales are 7.33907556533813f and 7.33907508850098f, different
tilings get created, when scale is changed from one to other. Although
tiles are shared between different tilings, the contents at previous
scale needs to be re-rastered with new scale. This causes unnecessary
performance hit.
This patch adds gfx::Scale class, which converts the scale factor
with given floating point to fixed precision floating point. This makes
above two scale factors appear as equal. The above two scales will get
converted as given below, when precision is set as 3.
7.33907556533813 -> 7.339000225067138671875
7.33907508850098 -> 7.339000225067138671875
This patch just adds Scale class and its unit test. Using gfx::Scale
class the precision related differences can be brought into single
class and in it by converting the scale to fixed precision, the
peformance hit could be solved.
BUG=327166
Patch Set 1 #Patch Set 2 : Corrected simple nit. #
Depends on Patchset: Messages
Total messages: 11 (1 generated)
|