10 |
|
|
11 |
from test.tools.gfx import * |
from test.tools.gfx import * |
12 |
|
|
13 |
|
gzz.gfx.gl.PageSpanPaper.paperMill = gzz.gfx.gl.PaperMill.getInstance() |
14 |
|
gzz.gfx.gl.PageSpanPaper.paperMillWindow = win |
15 |
|
|
16 |
id = "01ACE8A2E202A26072012715A94A270CD012F9B0F2" |
id = "01ACE8A2E202A26072012715A94A270CD012F9B0F2" |
17 |
sc = gzz.media.impl.PageImageScroll(None, gzz.mediaserver.Mediaserver.Id(id)) |
sc = gzz.media.impl.PageImageScroll(None, gzz.mediaserver.Mediaserver.Id(id)) |
18 |
|
|
55 |
def checkBlank(): |
def checkBlank(): |
56 |
checkAvgColor(100, 100, 3, 20, (255, 255, 255)) |
checkAvgColor(100, 100, 3, 20, (255, 255, 255)) |
57 |
|
|
58 |
def checkPaper(bgpaper, blank): |
def checkPaper(blank): |
59 |
|
|
60 |
pagespan = GLSpanner.getSpanRect(sc.getCurrent()).page |
pagespan = GLSpanner.getSpanRect(sc.getCurrent()).page |
61 |
p = PageSpanPaper(bgpaper, pagespan) |
p = PageSpanPaper(pagespan, 42) |
62 |
|
|
63 |
pap = p.getPaper(not blank) |
pap = p.getPaper(not blank) |
64 |
|
|
95 |
"""Test that the image gets loaded correctly from GLSpanner. |
"""Test that the image gets loaded correctly from GLSpanner. |
96 |
|
|
97 |
""" |
""" |
98 |
checkPaper(None, 1) |
checkPaper(0) |
99 |
|
checkPaper(1) |
|
def testUnoptimized(): |
|
|
"""Test that rendering the paper on top of fancy unoptimized |
|
|
paper works. |
|
|
|
|
|
""" |
|
|
|
|
|
checkPaper(PaperMill.getInstance().getPaper(42), 1) |
|
|
checkPaper(PaperMill.getInstance().getPaper(42), 0) |
|
|
|
|
|
def testOptimized(): |
|
|
"""Test that rendering the paper on top of fancy optimized |
|
|
paper works. |
|
|
|
|
|
""" |
|
|
|
|
|
checkPaper(PaperMill.getInstance().getOptimizedPaper(43, win), 1) |
|
|
checkPaper(PaperMill.getInstance().getOptimizedPaper(43, win), 0) |
|
|
|
|
|
|
|
|
# : vim: set syntax=python : |
|