Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1806 | yogev_ezra | 1 | |
2 | -------------------------------- |
||
3 | |||
4 | |||
5 | the the best dirtyrect candidates for merging. While |
||
6 | searching, it looks out for perfect or sufficiently |
||
7 | good candidates. |
||
8 | |||
9 | |||
10 | The merged rectangle is of the same size |
||
11 | as the largest of the two input rectangles: |
||
12 | |||
13 | |||
14 | |||
15 | |||
16 | |||
17 | |||
18 | Not Perfect, but good enough to be treated |
||
19 | as such, considering the cost of going on |
||
20 | searching for a better candidate: |
||
21 | Amerged 100 / MAX(A1, A2) - 100 <= PIG_INSTANT_MERGE |
||
22 | |||
23 | |||
24 | no more than PIG_INSTANT_MERGE % bigger than |
||
25 | the area of the larger of the two input rects.) |
||
26 | |||
27 | |||
28 | that thereis* a better candidate. Assuming |
||
29 | that PIG_INSTANT_MERGE is set to a sensible |
||
30 | value, it is not very likely at all. There |
||
31 | would have to be another dirtyrect nearby, and |
||
32 | the chance of that being a better match is |
||
33 | rather low, since that would most likely have |
||
34 | caused it to be merged with the tested dirtyrect |
||
35 | long before our new rect came in. |
||
36 | |||
37 | |||
38 | The area of the merged rectangle is smaller |
||
39 | than the total area of the two input rectangles: |
||
40 | |||
41 | |||
42 | |||
43 | |||
44 | |||
45 | |||
46 | The area of the merged rectangle is larger |
||
47 | than the total of the two input rectangles, but |
||
48 | since there is some per-rectangle overhead, |
||
49 | merging is still a win: |
||
50 | |||
51 | |||
52 | |||
53 | |||
54 | rectangle is in the range of 300 pixels. One |
||
55 | should probably benchmark a few different systems |
||
56 | to see if that's reasonable. |
||
57 | |||
58 | |||
59 | The area of the merged rectangle is larger than |
||
60 | the total of the input rectangles to the degree |
||
61 | that merging is a definite loss: |
||
62 | |||
63 | |||
64 | |||
65 | |||
66 | solutions. If there are only Good and Acceptable |
||
67 | candidates, the best one (lowest number of wasted |
||
68 | pixels) is the solution. |
||
69 | |||
70 | |||
71 | sensible merger solution, so pig_dirty() will try to add |
||
72 | a new dirtyrect. |
||
73 | |||
74 | |||
75 | even though it would have been Unacceptable under normal |
||
76 | circumstances. |
||
77 | |||
78 | |||
79 | |||
80 | TODO: "don't merge"! For example, it might pay off to |
||
81 | TODO: detect overlapping and clip dirtyrects to avoid |
||
82 | TODO: it, when merging is not a viable option.=>>=>=> |
||
83 |