| 1530 | } |
| 1531 | |
| 1532 | void |
| 1533 | ViewerGL::endTransferBufferFromRAMToGPU(int textureIndex, |
| 1534 | const TexturePtr& texture, |
| 1535 | const ImagePtr& image, |
| 1536 | int time, |
| 1537 | const RectD& rod, |
| 1538 | double par, |
| 1539 | ImageBitDepthEnum depth, |
| 1540 | unsigned int mipMapLevel, |
| 1541 | ImagePremultiplicationEnum premult, |
| 1542 | double gain, |
| 1543 | double gamma, |
| 1544 | double offset, |
| 1545 | int lut, |
| 1546 | bool recenterViewer, |
| 1547 | const Point& viewportCenter, |
| 1548 | bool isPartialRect) |
| 1549 | { |
| 1550 | if (recenterViewer) { |
| 1551 | QMutexLocker k(&_imp->zoomCtxMutex); |
| 1552 | double curCenterX = ( _imp->zoomCtx.left() + _imp->zoomCtx.right() ) / 2.; |
| 1553 | double curCenterY = ( _imp->zoomCtx.bottom() + _imp->zoomCtx.top() ) / 2.; |
| 1554 | _imp->zoomCtx.translate(viewportCenter.x - curCenterX, viewportCenter.y - curCenterY); |
| 1555 | } |
| 1556 | |
| 1557 | if (isPartialRect) { |
| 1558 | TextureInfo info; |
| 1559 | info.texture = std::dynamic_pointer_cast<Texture>(texture); |
| 1560 | info.gain = gain; |
| 1561 | info.gamma = gamma; |
| 1562 | info.offset = offset; |
| 1563 | info.mipMapLevel = mipMapLevel; |
| 1564 | info.premult = premult; |
| 1565 | info.time = time; |
| 1566 | info.memoryHeldByLastRenderedImages = 0; |
| 1567 | info.isPartialImage = true; |
| 1568 | info.isVisible = true; |
| 1569 | _imp->partialUpdateTextures.push_back(info); |
| 1570 | // Update time otherwise overlays won't refresh |
| 1571 | _imp->displayTextures[0].time = time; |
| 1572 | _imp->displayTextures[1].time = time; |
| 1573 | } else { |
| 1574 | ViewerInstance* internalNode = getInternalNode(); |
| 1575 | _imp->displayTextures[textureIndex].isVisible = true; |
| 1576 | _imp->displayTextures[textureIndex].gain = gain; |
| 1577 | _imp->displayTextures[textureIndex].gamma = gamma; |
| 1578 | _imp->displayTextures[textureIndex].offset = offset; |
| 1579 | _imp->displayTextures[textureIndex].mipMapLevel = mipMapLevel; |
| 1580 | _imp->displayingImageLut = (ViewerColorSpaceEnum)lut; |
| 1581 | _imp->displayTextures[textureIndex].premult = premult; |
| 1582 | _imp->displayTextures[textureIndex].time = time; |
| 1583 | |
| 1584 | if (_imp->displayTextures[textureIndex].memoryHeldByLastRenderedImages > 0) { |
| 1585 | internalNode->unregisterPluginMemory(_imp->displayTextures[textureIndex].memoryHeldByLastRenderedImages); |
| 1586 | _imp->displayTextures[textureIndex].memoryHeldByLastRenderedImages = 0; |
| 1587 | } |
| 1588 | |
| 1589 |
no test coverage detected