Commit a3f81eb
committed
OpenGL: Correctly restore blend mode when nested context goes out-of-scope
Fixes an issue where primitives such as text could end up with sharp
edges when creating temporary contexts:
void paint (Graphics& g)
{
g.fillAll (Colours::white);
const auto preferredType = g.getInternalContext().getPreferredImageTypeForTemporaryImages();
Image img (Image::ARGB, getWidth(), getHeight(), false, *preferredType);
{
Graphics g2 (img);
}
g.setColour (Colours::black);
g.setFont (32);
g.drawText ("test", getLocalBounds(), Justification::centred);
}1 parent 2efd3e0 commit a3f81eb
1 file changed
+28
-2
lines changedLines changed: 28 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
978 | 978 | | |
979 | 979 | | |
980 | 980 | | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
981 | 995 | | |
982 | 996 | | |
983 | 997 | | |
| |||
1030 | 1044 | | |
1031 | 1045 | | |
1032 | 1046 | | |
1033 | | - | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
1034 | 1054 | | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1035 | 1061 | | |
1036 | 1062 | | |
1037 | 1063 | | |
| |||
1786 | 1812 | | |
1787 | 1813 | | |
1788 | 1814 | | |
1789 | | - | |
| 1815 | + | |
1790 | 1816 | | |
1791 | 1817 | | |
1792 | 1818 | | |
| |||
0 commit comments