| 1124 | }; |
| 1125 | |
| 1126 | GraphicsPtr Widget::getGraphics(const gfx::Rect& clip) |
| 1127 | { |
| 1128 | GraphicsPtr graphics; |
| 1129 | she::Surface* surface; |
| 1130 | she::Surface* defaultSurface = she::instance()->defaultDisplay()->getSurface(); |
| 1131 | |
| 1132 | // In case of double-buffering, we need to create the temporary |
| 1133 | // buffer only if the default surface is the screen. |
| 1134 | if (isDoubleBuffered() && defaultSurface->isDirectToScreen()) { |
| 1135 | surface = she::instance()->createSurface(clip.w, clip.h); |
| 1136 | graphics.reset(new Graphics(surface, -clip.x, -clip.y), |
| 1137 | DeleteGraphicsAndSurface(clip, surface)); |
| 1138 | } |
| 1139 | // In other case, we can draw directly onto the screen. |
| 1140 | else { |
| 1141 | surface = defaultSurface; |
| 1142 | graphics.reset(new Graphics(surface, bounds().x, bounds().y)); |
| 1143 | } |
| 1144 | |
| 1145 | graphics->setFont(font()); |
| 1146 | return graphics; |
| 1147 | } |
| 1148 | |
| 1149 | // =============================================================== |
| 1150 | // GUI MANAGER |
nothing calls this directly
no test coverage detected