| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qsurfaceformat.cpp | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | class QSurfaceFormatPrivate | - | ||||||||||||
| 5 | { | - | ||||||||||||
| 6 | public: | - | ||||||||||||
| 7 | explicit QSurfaceFormatPrivate(QSurfaceFormat::FormatOptions _opts = 0) | - | ||||||||||||
| 8 | : ref(1) | - | ||||||||||||
| 9 | , opts(_opts) | - | ||||||||||||
| 10 | , redBufferSize(-1) | - | ||||||||||||
| 11 | , greenBufferSize(-1) | - | ||||||||||||
| 12 | , blueBufferSize(-1) | - | ||||||||||||
| 13 | , alphaBufferSize(-1) | - | ||||||||||||
| 14 | , depthSize(-1) | - | ||||||||||||
| 15 | , stencilSize(-1) | - | ||||||||||||
| 16 | , swapBehavior(QSurfaceFormat::DefaultSwapBehavior) | - | ||||||||||||
| 17 | , numSamples(-1) | - | ||||||||||||
| 18 | , renderableType(QSurfaceFormat::DefaultRenderableType) | - | ||||||||||||
| 19 | , profile(QSurfaceFormat::NoProfile) | - | ||||||||||||
| 20 | , major(2) | - | ||||||||||||
| 21 | , minor(0) | - | ||||||||||||
| 22 | , swapInterval(1) | - | ||||||||||||
| 23 | { | - | ||||||||||||
| 24 |     } never executed:  end of block | 0 | ||||||||||||
| 25 | - | |||||||||||||
| 26 | QSurfaceFormatPrivate(const QSurfaceFormatPrivate *other) | - | ||||||||||||
| 27 | : ref(1), | - | ||||||||||||
| 28 | opts(other->opts), | - | ||||||||||||
| 29 | redBufferSize(other->redBufferSize), | - | ||||||||||||
| 30 | greenBufferSize(other->greenBufferSize), | - | ||||||||||||
| 31 | blueBufferSize(other->blueBufferSize), | - | ||||||||||||
| 32 | alphaBufferSize(other->alphaBufferSize), | - | ||||||||||||
| 33 | depthSize(other->depthSize), | - | ||||||||||||
| 34 | stencilSize(other->stencilSize), | - | ||||||||||||
| 35 | swapBehavior(other->swapBehavior), | - | ||||||||||||
| 36 | numSamples(other->numSamples), | - | ||||||||||||
| 37 | renderableType(other->renderableType), | - | ||||||||||||
| 38 | profile(other->profile), | - | ||||||||||||
| 39 | major(other->major), | - | ||||||||||||
| 40 | minor(other->minor), | - | ||||||||||||
| 41 | swapInterval(other->swapInterval) | - | ||||||||||||
| 42 | { | - | ||||||||||||
| 43 |     } never executed:  end of block | 0 | ||||||||||||
| 44 | - | |||||||||||||
| 45 | QAtomicInt ref; | - | ||||||||||||
| 46 | QSurfaceFormat::FormatOptions opts; | - | ||||||||||||
| 47 | int redBufferSize; | - | ||||||||||||
| 48 | int greenBufferSize; | - | ||||||||||||
| 49 | int blueBufferSize; | - | ||||||||||||
| 50 | int alphaBufferSize; | - | ||||||||||||
| 51 | int depthSize; | - | ||||||||||||
| 52 | int stencilSize; | - | ||||||||||||
| 53 | QSurfaceFormat::SwapBehavior swapBehavior; | - | ||||||||||||
| 54 | int numSamples; | - | ||||||||||||
| 55 | QSurfaceFormat::RenderableType renderableType; | - | ||||||||||||
| 56 | QSurfaceFormat::OpenGLContextProfile profile; | - | ||||||||||||
| 57 | int major; | - | ||||||||||||
| 58 | int minor; | - | ||||||||||||
| 59 | int swapInterval; | - | ||||||||||||
| 60 | }; | - | ||||||||||||
| 61 | QSurfaceFormat::QSurfaceFormat() : d(new QSurfaceFormatPrivate) | - | ||||||||||||
| 62 | { | - | ||||||||||||
| 63 | } never executed:  end of block | 0 | ||||||||||||
| 64 | - | |||||||||||||
| 65 | - | |||||||||||||
| 66 | - | |||||||||||||
| 67 | - | |||||||||||||
| 68 | QSurfaceFormat::QSurfaceFormat(QSurfaceFormat::FormatOptions options) : | - | ||||||||||||
| 69 | d(new QSurfaceFormatPrivate(options)) | - | ||||||||||||
| 70 | { | - | ||||||||||||
| 71 | } never executed:  end of block | 0 | ||||||||||||
| 72 | - | |||||||||||||
| 73 | - | |||||||||||||
| 74 | - | |||||||||||||
| 75 | - | |||||||||||||
| 76 | void QSurfaceFormat::detach() | - | ||||||||||||
| 77 | { | - | ||||||||||||
| 78 |     if (d->ref.load() != 1
  | 0 | ||||||||||||
| 79 | QSurfaceFormatPrivate *newd = new QSurfaceFormatPrivate(d); | - | ||||||||||||
| 80 |         if (!d->ref.deref()
  | 0 | ||||||||||||
| 81 |             delete d; never executed:  delete d; | 0 | ||||||||||||
| 82 | d = newd; | - | ||||||||||||
| 83 |     } never executed:  end of block | 0 | ||||||||||||
| 84 | } never executed:  end of block | 0 | ||||||||||||
| 85 | - | |||||||||||||
| 86 | - | |||||||||||||
| 87 | - | |||||||||||||
| 88 | - | |||||||||||||
| 89 | QSurfaceFormat::QSurfaceFormat(const QSurfaceFormat &other) | - | ||||||||||||
| 90 | { | - | ||||||||||||
| 91 | d = other.d; | - | ||||||||||||
| 92 | d->ref.ref(); | - | ||||||||||||
| 93 | } never executed:  end of block | 0 | ||||||||||||
| 94 | - | |||||||||||||
| 95 | - | |||||||||||||
| 96 | - | |||||||||||||
| 97 | - | |||||||||||||
| 98 | QSurfaceFormat &QSurfaceFormat::operator=(const QSurfaceFormat &other) | - | ||||||||||||
| 99 | { | - | ||||||||||||
| 100 |     if (d != other.d
  | 0 | ||||||||||||
| 101 | other.d->ref.ref(); | - | ||||||||||||
| 102 |         if (!d->ref.deref()
  | 0 | ||||||||||||
| 103 |             delete d; never executed:  delete d; | 0 | ||||||||||||
| 104 | d = other.d; | - | ||||||||||||
| 105 |     } never executed:  end of block | 0 | ||||||||||||
| 106 |     return never executed:   *this;return *this;never executed:  return *this; | 0 | ||||||||||||
| 107 | } | - | ||||||||||||
| 108 | - | |||||||||||||
| 109 | - | |||||||||||||
| 110 | - | |||||||||||||
| 111 | - | |||||||||||||
| 112 | QSurfaceFormat::~QSurfaceFormat() | - | ||||||||||||
| 113 | { | - | ||||||||||||
| 114 |     if (!d->ref.deref()
  | 0 | ||||||||||||
| 115 |         delete d; never executed:  delete d; | 0 | ||||||||||||
| 116 | } never executed:  end of block | 0 | ||||||||||||
| 117 | void QSurfaceFormat::setStereo(bool enable) | - | ||||||||||||
| 118 | { | - | ||||||||||||
| 119 | QSurfaceFormat::FormatOptions newOptions = d->opts; | - | ||||||||||||
| 120 | newOptions.setFlag(QSurfaceFormat::StereoBuffers, enable); | - | ||||||||||||
| 121 | - | |||||||||||||
| 122 |     if (int(newOptions) != int(d->opts)
  | 0 | ||||||||||||
| 123 | detach(); | - | ||||||||||||
| 124 | d->opts = newOptions; | - | ||||||||||||
| 125 |     } never executed:  end of block | 0 | ||||||||||||
| 126 | } never executed:  end of block | 0 | ||||||||||||
| 127 | - | |||||||||||||
| 128 | - | |||||||||||||
| 129 | - | |||||||||||||
| 130 | - | |||||||||||||
| 131 | - | |||||||||||||
| 132 | - | |||||||||||||
| 133 | - | |||||||||||||
| 134 | int QSurfaceFormat::samples() const | - | ||||||||||||
| 135 | { | - | ||||||||||||
| 136 |    return never executed:   d->numSamples;return d->numSamples;never executed:  return d->numSamples; | 0 | ||||||||||||
| 137 | } | - | ||||||||||||
| 138 | - | |||||||||||||
| 139 | - | |||||||||||||
| 140 | - | |||||||||||||
| 141 | - | |||||||||||||
| 142 | - | |||||||||||||
| 143 | - | |||||||||||||
| 144 | - | |||||||||||||
| 145 | void QSurfaceFormat::setSamples(int numSamples) | - | ||||||||||||
| 146 | { | - | ||||||||||||
| 147 |     if (d->numSamples != numSamples
  | 0 | ||||||||||||
| 148 | detach(); | - | ||||||||||||
| 149 | d->numSamples = numSamples; | - | ||||||||||||
| 150 |     } never executed:  end of block | 0 | ||||||||||||
| 151 | } never executed:  end of block | 0 | ||||||||||||
| 152 | void QSurfaceFormat::setOption(QSurfaceFormat::FormatOptions opt) | - | ||||||||||||
| 153 | { | - | ||||||||||||
| 154 | const QSurfaceFormat::FormatOptions newOptions = d->opts | opt; | - | ||||||||||||
| 155 |     if (int(newOptions) != int(d->opts)
  | 0 | ||||||||||||
| 156 | detach(); | - | ||||||||||||
| 157 | d->opts = newOptions; | - | ||||||||||||
| 158 |     } never executed:  end of block | 0 | ||||||||||||
| 159 | } never executed:  end of block | 0 | ||||||||||||
| 160 | bool QSurfaceFormat::testOption(QSurfaceFormat::FormatOptions opt) const | - | ||||||||||||
| 161 | { | - | ||||||||||||
| 162 |     return never executed:   d->opts & opt;return d->opts & opt;never executed:  return d->opts & opt; | 0 | ||||||||||||
| 163 | } | - | ||||||||||||
| 164 | void QSurfaceFormat::setOptions(QSurfaceFormat::FormatOptions options) | - | ||||||||||||
| 165 | { | - | ||||||||||||
| 166 |     if (int(d->opts) != int(options)
  | 0 | ||||||||||||
| 167 | detach(); | - | ||||||||||||
| 168 | d->opts = options; | - | ||||||||||||
| 169 |     } never executed:  end of block | 0 | ||||||||||||
| 170 | } never executed:  end of block | 0 | ||||||||||||
| 171 | void QSurfaceFormat::setOption(QSurfaceFormat::FormatOption option, bool on) | - | ||||||||||||
| 172 | { | - | ||||||||||||
| 173 |     if (testOption(option) == on
  | 0 | ||||||||||||
| 174 |         return; never executed:  return; | 0 | ||||||||||||
| 175 | detach(); | - | ||||||||||||
| 176 |     if (on
  | 0 | ||||||||||||
| 177 |         d->opts |= option; never executed:  d->opts |= option; | 0 | ||||||||||||
| 178 | else | - | ||||||||||||
| 179 |         d->opts &= ~option; never executed:  d->opts &= ~option; | 0 | ||||||||||||
| 180 | } | - | ||||||||||||
| 181 | bool QSurfaceFormat::testOption(QSurfaceFormat::FormatOption option) const | - | ||||||||||||
| 182 | { | - | ||||||||||||
| 183 |     return never executed:   d->opts & option;return d->opts & option;never executed:  return d->opts & option; | 0 | ||||||||||||
| 184 | } | - | ||||||||||||
| 185 | QSurfaceFormat::FormatOptions QSurfaceFormat::options() const | - | ||||||||||||
| 186 | { | - | ||||||||||||
| 187 |     return never executed:   d->opts;return d->opts;never executed:  return d->opts; | 0 | ||||||||||||
| 188 | } | - | ||||||||||||
| 189 | - | |||||||||||||
| 190 | - | |||||||||||||
| 191 | - | |||||||||||||
| 192 | - | |||||||||||||
| 193 | - | |||||||||||||
| 194 | - | |||||||||||||
| 195 | void QSurfaceFormat::setDepthBufferSize(int size) | - | ||||||||||||
| 196 | { | - | ||||||||||||
| 197 |     if (d->depthSize != size
  | 0 | ||||||||||||
| 198 | detach(); | - | ||||||||||||
| 199 | d->depthSize = size; | - | ||||||||||||
| 200 |     } never executed:  end of block | 0 | ||||||||||||
| 201 | } never executed:  end of block | 0 | ||||||||||||
| 202 | - | |||||||||||||
| 203 | - | |||||||||||||
| 204 | - | |||||||||||||
| 205 | - | |||||||||||||
| 206 | - | |||||||||||||
| 207 | - | |||||||||||||
| 208 | int QSurfaceFormat::depthBufferSize() const | - | ||||||||||||
| 209 | { | - | ||||||||||||
| 210 |    return never executed:   d->depthSize;return d->depthSize;never executed:  return d->depthSize; | 0 | ||||||||||||
| 211 | } | - | ||||||||||||
| 212 | void QSurfaceFormat::setSwapBehavior(SwapBehavior behavior) | - | ||||||||||||
| 213 | { | - | ||||||||||||
| 214 |     if (d->swapBehavior != behavior
  | 0 | ||||||||||||
| 215 | detach(); | - | ||||||||||||
| 216 | d->swapBehavior = behavior; | - | ||||||||||||
| 217 |     } never executed:  end of block | 0 | ||||||||||||
| 218 | } never executed:  end of block | 0 | ||||||||||||
| 219 | - | |||||||||||||
| 220 | - | |||||||||||||
| 221 | - | |||||||||||||
| 222 | - | |||||||||||||
| 223 | - | |||||||||||||
| 224 | - | |||||||||||||
| 225 | QSurfaceFormat::SwapBehavior QSurfaceFormat::swapBehavior() const | - | ||||||||||||
| 226 | { | - | ||||||||||||
| 227 |     return never executed:   d->swapBehavior;return d->swapBehavior;never executed:  return d->swapBehavior; | 0 | ||||||||||||
| 228 | } | - | ||||||||||||
| 229 | - | |||||||||||||
| 230 | - | |||||||||||||
| 231 | - | |||||||||||||
| 232 | - | |||||||||||||
| 233 | - | |||||||||||||
| 234 | - | |||||||||||||
| 235 | - | |||||||||||||
| 236 | bool QSurfaceFormat::hasAlpha() const | - | ||||||||||||
| 237 | { | - | ||||||||||||
| 238 |     return never executed:   d->alphaBufferSize > 0;return d->alphaBufferSize > 0;never executed:  return d->alphaBufferSize > 0; | 0 | ||||||||||||
| 239 | } | - | ||||||||||||
| 240 | - | |||||||||||||
| 241 | - | |||||||||||||
| 242 | - | |||||||||||||
| 243 | - | |||||||||||||
| 244 | - | |||||||||||||
| 245 | - | |||||||||||||
| 246 | void QSurfaceFormat::setStencilBufferSize(int size) | - | ||||||||||||
| 247 | { | - | ||||||||||||
| 248 |     if (d->stencilSize != size
  | 0 | ||||||||||||
| 249 | detach(); | - | ||||||||||||
| 250 | d->stencilSize = size; | - | ||||||||||||
| 251 |     } never executed:  end of block | 0 | ||||||||||||
| 252 | } never executed:  end of block | 0 | ||||||||||||
| 253 | - | |||||||||||||
| 254 | - | |||||||||||||
| 255 | - | |||||||||||||
| 256 | - | |||||||||||||
| 257 | - | |||||||||||||
| 258 | - | |||||||||||||
| 259 | int QSurfaceFormat::stencilBufferSize() const | - | ||||||||||||
| 260 | { | - | ||||||||||||
| 261 |    return never executed:   d->stencilSize;return d->stencilSize;never executed:  return d->stencilSize; | 0 | ||||||||||||
| 262 | } | - | ||||||||||||
| 263 | - | |||||||||||||
| 264 | - | |||||||||||||
| 265 | - | |||||||||||||
| 266 | - | |||||||||||||
| 267 | int QSurfaceFormat::redBufferSize() const | - | ||||||||||||
| 268 | { | - | ||||||||||||
| 269 |     return never executed:   d->redBufferSize;return d->redBufferSize;never executed:  return d->redBufferSize; | 0 | ||||||||||||
| 270 | } | - | ||||||||||||
| 271 | - | |||||||||||||
| 272 | - | |||||||||||||
| 273 | - | |||||||||||||
| 274 | - | |||||||||||||
| 275 | int QSurfaceFormat::greenBufferSize() const | - | ||||||||||||
| 276 | { | - | ||||||||||||
| 277 |     return never executed:   d->greenBufferSize;return d->greenBufferSize;never executed:  return d->greenBufferSize; | 0 | ||||||||||||
| 278 | } | - | ||||||||||||
| 279 | - | |||||||||||||
| 280 | - | |||||||||||||
| 281 | - | |||||||||||||
| 282 | - | |||||||||||||
| 283 | int QSurfaceFormat::blueBufferSize() const | - | ||||||||||||
| 284 | { | - | ||||||||||||
| 285 |     return never executed:   d->blueBufferSize;return d->blueBufferSize;never executed:  return d->blueBufferSize; | 0 | ||||||||||||
| 286 | } | - | ||||||||||||
| 287 | - | |||||||||||||
| 288 | - | |||||||||||||
| 289 | - | |||||||||||||
| 290 | - | |||||||||||||
| 291 | int QSurfaceFormat::alphaBufferSize() const | - | ||||||||||||
| 292 | { | - | ||||||||||||
| 293 |     return never executed:   d->alphaBufferSize;return d->alphaBufferSize;never executed:  return d->alphaBufferSize; | 0 | ||||||||||||
| 294 | } | - | ||||||||||||
| 295 | void QSurfaceFormat::setRedBufferSize(int size) | - | ||||||||||||
| 296 | { | - | ||||||||||||
| 297 |     if (d->redBufferSize != size
  | 0 | ||||||||||||
| 298 | detach(); | - | ||||||||||||
| 299 | d->redBufferSize = size; | - | ||||||||||||
| 300 |     } never executed:  end of block | 0 | ||||||||||||
| 301 | } never executed:  end of block | 0 | ||||||||||||
| 302 | void QSurfaceFormat::setGreenBufferSize(int size) | - | ||||||||||||
| 303 | { | - | ||||||||||||
| 304 |     if (d->greenBufferSize != size
  | 0 | ||||||||||||
| 305 | detach(); | - | ||||||||||||
| 306 | d->greenBufferSize = size; | - | ||||||||||||
| 307 |     } never executed:  end of block | 0 | ||||||||||||
| 308 | } never executed:  end of block | 0 | ||||||||||||
| 309 | void QSurfaceFormat::setBlueBufferSize(int size) | - | ||||||||||||
| 310 | { | - | ||||||||||||
| 311 |     if (d->blueBufferSize != size
  | 0 | ||||||||||||
| 312 | detach(); | - | ||||||||||||
| 313 | d->blueBufferSize = size; | - | ||||||||||||
| 314 |     } never executed:  end of block | 0 | ||||||||||||
| 315 | } never executed:  end of block | 0 | ||||||||||||
| 316 | - | |||||||||||||
| 317 | - | |||||||||||||
| 318 | - | |||||||||||||
| 319 | - | |||||||||||||
| 320 | void QSurfaceFormat::setAlphaBufferSize(int size) | - | ||||||||||||
| 321 | { | - | ||||||||||||
| 322 |     if (d->alphaBufferSize != size
  | 0 | ||||||||||||
| 323 | detach(); | - | ||||||||||||
| 324 | d->alphaBufferSize = size; | - | ||||||||||||
| 325 |     } never executed:  end of block | 0 | ||||||||||||
| 326 | } never executed:  end of block | 0 | ||||||||||||
| 327 | - | |||||||||||||
| 328 | - | |||||||||||||
| 329 | - | |||||||||||||
| 330 | - | |||||||||||||
| 331 | - | |||||||||||||
| 332 | - | |||||||||||||
| 333 | void QSurfaceFormat::setRenderableType(RenderableType type) | - | ||||||||||||
| 334 | { | - | ||||||||||||
| 335 |     if (d->renderableType != type
  | 0 | ||||||||||||
| 336 | detach(); | - | ||||||||||||
| 337 | d->renderableType = type; | - | ||||||||||||
| 338 |     } never executed:  end of block | 0 | ||||||||||||
| 339 | } never executed:  end of block | 0 | ||||||||||||
| 340 | - | |||||||||||||
| 341 | - | |||||||||||||
| 342 | - | |||||||||||||
| 343 | - | |||||||||||||
| 344 | - | |||||||||||||
| 345 | - | |||||||||||||
| 346 | QSurfaceFormat::RenderableType QSurfaceFormat::renderableType() const | - | ||||||||||||
| 347 | { | - | ||||||||||||
| 348 |     return never executed:   d->renderableType;return d->renderableType;never executed:  return d->renderableType; | 0 | ||||||||||||
| 349 | } | - | ||||||||||||
| 350 | - | |||||||||||||
| 351 | - | |||||||||||||
| 352 | - | |||||||||||||
| 353 | - | |||||||||||||
| 354 | - | |||||||||||||
| 355 | - | |||||||||||||
| 356 | - | |||||||||||||
| 357 | void QSurfaceFormat::setProfile(OpenGLContextProfile profile) | - | ||||||||||||
| 358 | { | - | ||||||||||||
| 359 |     if (d->profile != profile
  | 0 | ||||||||||||
| 360 | detach(); | - | ||||||||||||
| 361 | d->profile = profile; | - | ||||||||||||
| 362 |     } never executed:  end of block | 0 | ||||||||||||
| 363 | } never executed:  end of block | 0 | ||||||||||||
| 364 | - | |||||||||||||
| 365 | - | |||||||||||||
| 366 | - | |||||||||||||
| 367 | - | |||||||||||||
| 368 | - | |||||||||||||
| 369 | - | |||||||||||||
| 370 | - | |||||||||||||
| 371 | QSurfaceFormat::OpenGLContextProfile QSurfaceFormat::profile() const | - | ||||||||||||
| 372 | { | - | ||||||||||||
| 373 |     return never executed:   d->profile;return d->profile;never executed:  return d->profile; | 0 | ||||||||||||
| 374 | } | - | ||||||||||||
| 375 | - | |||||||||||||
| 376 | - | |||||||||||||
| 377 | - | |||||||||||||
| 378 | - | |||||||||||||
| 379 | void QSurfaceFormat::setMajorVersion(int major) | - | ||||||||||||
| 380 | { | - | ||||||||||||
| 381 |     if (d->major != major
  | 0 | ||||||||||||
| 382 | detach(); | - | ||||||||||||
| 383 | d->major = major; | - | ||||||||||||
| 384 |     } never executed:  end of block | 0 | ||||||||||||
| 385 | } never executed:  end of block | 0 | ||||||||||||
| 386 | - | |||||||||||||
| 387 | - | |||||||||||||
| 388 | - | |||||||||||||
| 389 | - | |||||||||||||
| 390 | - | |||||||||||||
| 391 | - | |||||||||||||
| 392 | int QSurfaceFormat::majorVersion() const | - | ||||||||||||
| 393 | { | - | ||||||||||||
| 394 |     return never executed:   d->major;return d->major;never executed:  return d->major; | 0 | ||||||||||||
| 395 | } | - | ||||||||||||
| 396 | - | |||||||||||||
| 397 | - | |||||||||||||
| 398 | - | |||||||||||||
| 399 | - | |||||||||||||
| 400 | - | |||||||||||||
| 401 | - | |||||||||||||
| 402 | void QSurfaceFormat::setMinorVersion(int minor) | - | ||||||||||||
| 403 | { | - | ||||||||||||
| 404 |     if (d->minor != minor
  | 0 | ||||||||||||
| 405 | detach(); | - | ||||||||||||
| 406 | d->minor = minor; | - | ||||||||||||
| 407 |     } never executed:  end of block | 0 | ||||||||||||
| 408 | } never executed:  end of block | 0 | ||||||||||||
| 409 | - | |||||||||||||
| 410 | - | |||||||||||||
| 411 | - | |||||||||||||
| 412 | - | |||||||||||||
| 413 | int QSurfaceFormat::minorVersion() const | - | ||||||||||||
| 414 | { | - | ||||||||||||
| 415 |     return never executed:   d->minor;return d->minor;never executed:  return d->minor; | 0 | ||||||||||||
| 416 | } | - | ||||||||||||
| 417 | - | |||||||||||||
| 418 | - | |||||||||||||
| 419 | - | |||||||||||||
| 420 | - | |||||||||||||
| 421 | - | |||||||||||||
| 422 | - | |||||||||||||
| 423 | QPair<int, int> QSurfaceFormat::version() const | - | ||||||||||||
| 424 | { | - | ||||||||||||
| 425 |     return never executed:   qMakePair(d->major, d->minor);return qMakePair(d->major, d->minor);never executed:  return qMakePair(d->major, d->minor); | 0 | ||||||||||||
| 426 | } | - | ||||||||||||
| 427 | - | |||||||||||||
| 428 | - | |||||||||||||
| 429 | - | |||||||||||||
| 430 | - | |||||||||||||
| 431 | - | |||||||||||||
| 432 | - | |||||||||||||
| 433 | void QSurfaceFormat::setVersion(int major, int minor) | - | ||||||||||||
| 434 | { | - | ||||||||||||
| 435 |     if (d->minor != minor
 
  | 0 | ||||||||||||
| 436 | detach(); | - | ||||||||||||
| 437 | d->minor = minor; | - | ||||||||||||
| 438 | d->major = major; | - | ||||||||||||
| 439 |     } never executed:  end of block | 0 | ||||||||||||
| 440 | } never executed:  end of block | 0 | ||||||||||||
| 441 | void QSurfaceFormat::setSwapInterval(int interval) | - | ||||||||||||
| 442 | { | - | ||||||||||||
| 443 |     if (d->swapInterval != interval
  | 0 | ||||||||||||
| 444 | detach(); | - | ||||||||||||
| 445 | d->swapInterval = interval; | - | ||||||||||||
| 446 |     } never executed:  end of block | 0 | ||||||||||||
| 447 | } never executed:  end of block | 0 | ||||||||||||
| 448 | int QSurfaceFormat::swapInterval() const | - | ||||||||||||
| 449 | { | - | ||||||||||||
| 450 |     return never executed:   d->swapInterval;return d->swapInterval;never executed:  return d->swapInterval; | 0 | ||||||||||||
| 451 | } | - | ||||||||||||
| 452 | - | |||||||||||||
| 453 | namespace { namespace Q_QGS_qt_default_surface_format { typedef QSurfaceFormat Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
 never executed:   }guard.store(QtGlobalStatic::Destroyed);never executed:   }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blocknever executed:   &holder.value;return &holder.value;never executed:   } } } static QGlobalStatic<QSurfaceFormat, Q_QGS_qt_default_surface_format::innerFunction, Q_QGS_qt_default_surface_format::guard> qt_default_surface_format;return &holder.value; | 0 | ||||||||||||
| 454 | void QSurfaceFormat::setDefaultFormat(const QSurfaceFormat &format) | - | ||||||||||||
| 455 | { | - | ||||||||||||
| 456 | - | |||||||||||||
| 457 |     if ((static_cast<
 
  | 0 | ||||||||||||
| 458 | QOpenGLContext *globalContext = QOpenGLContext::globalShareContext(); | - | ||||||||||||
| 459 |         if (globalContext
 
  | 0 | ||||||||||||
| 460 | QMessageLogger(__FILE__, 770, __PRETTY_FUNCTION__).warning("Warning: Setting a new default format with a different version or profile " | - | ||||||||||||
| 461 | "after the global shared context is created may cause issues with context " | - | ||||||||||||
| 462 | "sharing."); | - | ||||||||||||
| 463 |         } never executed:  end of block | 0 | ||||||||||||
| 464 |     } never executed:  end of block | 0 | ||||||||||||
| 465 | - | |||||||||||||
| 466 | *qt_default_surface_format() = format; | - | ||||||||||||
| 467 | } never executed:  end of block | 0 | ||||||||||||
| 468 | QSurfaceFormat QSurfaceFormat::defaultFormat() | - | ||||||||||||
| 469 | { | - | ||||||||||||
| 470 |     return never executed:   *qt_default_surface_format();return *qt_default_surface_format();never executed:  return *qt_default_surface_format(); | 0 | ||||||||||||
| 471 | } | - | ||||||||||||
| 472 | - | |||||||||||||
| 473 | - | |||||||||||||
| 474 | - | |||||||||||||
| 475 | - | |||||||||||||
| 476 | - | |||||||||||||
| 477 | - | |||||||||||||
| 478 | - | |||||||||||||
| 479 | bool operator==(const QSurfaceFormat& a, const QSurfaceFormat& b) | - | ||||||||||||
| 480 | { | - | ||||||||||||
| 481 |     return never executed:   (a.d == b.d) || ((int) a.d->opts == (int) b.d->optsreturn (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval);never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 482 |         && a.d->stencilSize == b.d->stencilSize never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 483 |         && a.d->redBufferSize == b.d->redBufferSize never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 484 |         && a.d->greenBufferSize == b.d->greenBufferSize never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 485 |         && a.d->blueBufferSize == b.d->blueBufferSize never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 486 |         && a.d->alphaBufferSize == b.d->alphaBufferSize never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 487 |         && a.d->depthSize == b.d->depthSize never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 488 |         && a.d->numSamples == b.d->numSamples never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 489 |         && a.d->swapBehavior == b.d->swapBehavior never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 490 |         && a.d->profile == b.d->profile never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 491 |         && a.d->major == b.d->major never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 492 |         && a.d->minor == b.d->minor never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 493 |         && a.d->swapInterval == b.d->swapInterval); never executed:  return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts && a.d->stencilSize == b.d->stencilSize && a.d->redBufferSize == b.d->redBufferSize && a.d->greenBufferSize == b.d->greenBufferSize && a.d->blueBufferSize == b.d->blueBufferSize && a.d->alphaBuffe...ferSize && a.d->depthSize == b.d->depthSize && a.d->numSamples == b.d->numSamples && a.d->swapBehavior == b.d->swapBehavior && a.d->profile == b.d->profile && a.d->major == b.d->major && a.d->minor == b.d->minor && a.d->swapInterval == b.d->swapInterval); | 0 | ||||||||||||
| 494 | } | - | ||||||||||||
| 495 | - | |||||||||||||
| 496 | - | |||||||||||||
| 497 | - | |||||||||||||
| 498 | - | |||||||||||||
| 499 | - | |||||||||||||
| 500 | - | |||||||||||||
| 501 | - | |||||||||||||
| 502 | bool operator!=(const QSurfaceFormat& a, const QSurfaceFormat& b) | - | ||||||||||||
| 503 | { | - | ||||||||||||
| 504 |     return never executed:   !(a == b);return !(a == b);never executed:  return !(a == b); | 0 | ||||||||||||
| 505 | } | - | ||||||||||||
| 506 | - | |||||||||||||
| 507 | - | |||||||||||||
| 508 | QDebug operator<<(QDebug dbg, const QSurfaceFormat &f) | - | ||||||||||||
| 509 | { | - | ||||||||||||
| 510 | const QSurfaceFormatPrivate * const d = f.d; | - | ||||||||||||
| 511 | QDebugStateSaver saver(dbg); | - | ||||||||||||
| 512 | - | |||||||||||||
| 513 | dbg.nospace() << "QSurfaceFormat(" | - | ||||||||||||
| 514 | << "version " << d->major << '.' << d->minor | - | ||||||||||||
| 515 | << ", options " << d->opts | - | ||||||||||||
| 516 | << ", depthBufferSize " << d->depthSize | - | ||||||||||||
| 517 | << ", redBufferSize " << d->redBufferSize | - | ||||||||||||
| 518 | << ", greenBufferSize " << d->greenBufferSize | - | ||||||||||||
| 519 | << ", blueBufferSize " << d->blueBufferSize | - | ||||||||||||
| 520 | << ", alphaBufferSize " << d->alphaBufferSize | - | ||||||||||||
| 521 | << ", stencilBufferSize " << d->stencilSize | - | ||||||||||||
| 522 | << ", samples " << d->numSamples | - | ||||||||||||
| 523 | << ", swapBehavior " << d->swapBehavior | - | ||||||||||||
| 524 | << ", swapInterval " << d->swapInterval | - | ||||||||||||
| 525 | << ", profile " << d->profile | - | ||||||||||||
| 526 | << ')'; | - | ||||||||||||
| 527 | - | |||||||||||||
| 528 |     return never executed:   dbg;return dbg;never executed:  return dbg; | 0 | ||||||||||||
| 529 | } | - | ||||||||||||
| 530 | - | |||||||||||||
| 531 | - | |||||||||||||
| 532 | - | |||||||||||||
| Switch to Source code | Preprocessed file |