mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-05-16 15:12:13 +00:00
Use QOpenGLShaderProgram::bind.
This commit is contained in:
parent
dd79b3c0d5
commit
b3648d0147
@ -789,7 +789,7 @@ void Viewport::RendererGL::paintTile(
|
||||
f.glDisable(GL_BLEND);
|
||||
});
|
||||
|
||||
f.glUseProgram(_imageProgram->programId());
|
||||
_imageProgram->bind();
|
||||
_imageProgram->setUniformValue("viewport", uniformViewport);
|
||||
_imageProgram->setUniformValue("s_texture", GLint(0));
|
||||
|
||||
@ -899,7 +899,7 @@ void Viewport::RendererGL::bindFrame(
|
||||
tileData.trackIndex = imageIndex;
|
||||
if (_rgbaFrame) {
|
||||
ensureARGB32Program();
|
||||
f.glUseProgram(program.argb32->programId());
|
||||
program.argb32->bind();
|
||||
f.glActiveTexture(GL_TEXTURE0);
|
||||
tileData.textures.bind(f, 0);
|
||||
if (upload) {
|
||||
@ -922,7 +922,7 @@ void Viewport::RendererGL::bindFrame(
|
||||
program.argb32->setUniformValue("s_texture", GLint(0));
|
||||
} else {
|
||||
const auto yuv = data.yuv420;
|
||||
f.glUseProgram(program.yuv420->programId());
|
||||
program.yuv420->bind();
|
||||
f.glActiveTexture(GL_TEXTURE0);
|
||||
tileData.textures.bind(f, 0);
|
||||
if (upload) {
|
||||
@ -1023,7 +1023,7 @@ void Viewport::RendererGL::drawFirstBlurPass(
|
||||
QSize blurSize) {
|
||||
tileData.framebuffers.bind(f, 1);
|
||||
|
||||
f.glUseProgram(_blurProgram->programId());
|
||||
_blurProgram->bind();
|
||||
f.glActiveTexture(GL_TEXTURE0);
|
||||
tileData.textures.bind(f, kScaleForBlurTextureIndex);
|
||||
|
||||
@ -1330,7 +1330,7 @@ void Viewport::RendererGL::validateNoiseTexture(
|
||||
&program,
|
||||
VertexShader({}),
|
||||
FragmentShader({ FragmentGenerateNoise() }));
|
||||
f.glUseProgram(program.programId());
|
||||
program.bind();
|
||||
|
||||
GLint position = program.attributeLocation("position");
|
||||
f.glVertexAttribPointer(
|
||||
|
@ -209,7 +209,7 @@ void OverlayWidget::RendererGL::paintTransformedVideoFrame(
|
||||
Assert(data.format == Streaming::FrameFormat::YUV420);
|
||||
Assert(!data.yuv420->size.isEmpty());
|
||||
const auto yuv = data.yuv420;
|
||||
_f->glUseProgram(_yuv420Program->programId());
|
||||
_yuv420Program->bind();
|
||||
|
||||
const auto upload = (_trackFrameIndex != data.index)
|
||||
|| (_streamedIndex != _owner->streamedIndex());
|
||||
@ -275,7 +275,7 @@ void OverlayWidget::RendererGL::paintTransformedStaticContent(
|
||||
auto &program = fillTransparentBackground
|
||||
? _withTransparencyProgram
|
||||
: _imageProgram;
|
||||
_f->glUseProgram(program->programId());
|
||||
program->bind();
|
||||
if (fillTransparentBackground) {
|
||||
program->setUniformValue(
|
||||
"transparentBg",
|
||||
@ -489,7 +489,7 @@ void OverlayWidget::RendererGL::paintControl(
|
||||
offset * 4 * sizeof(GLfloat),
|
||||
coords,
|
||||
sizeof(coords));
|
||||
_f->glUseProgram(_fillProgram->programId());
|
||||
_fillProgram->bind();
|
||||
_fillProgram->setUniformValue("viewport", _uniformViewport);
|
||||
FillRectangle(
|
||||
*_f,
|
||||
@ -502,7 +502,7 @@ void OverlayWidget::RendererGL::paintControl(
|
||||
coords + (fgOffset - offset) * 4,
|
||||
sizeof(coords) - (fgOffset - offset) * 4 * sizeof(GLfloat));
|
||||
}
|
||||
_f->glUseProgram(_controlsProgram->programId());
|
||||
_controlsProgram->bind();
|
||||
_controlsProgram->setUniformValue("g_opacity", GLfloat(innerOpacity));
|
||||
_controlsProgram->setUniformValue("viewport", _uniformViewport);
|
||||
FillTexturedRectangle(*_f, &*_controlsProgram, fgOffset);
|
||||
@ -654,7 +654,7 @@ void OverlayWidget::RendererGL::paintUsingRaster(
|
||||
coords,
|
||||
sizeof(coords));
|
||||
|
||||
_f->glUseProgram(_imageProgram->programId());
|
||||
_imageProgram->bind();
|
||||
_imageProgram->setUniformValue("viewport", _uniformViewport);
|
||||
_imageProgram->setUniformValue("s_texture", GLint(0));
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 4ae6d319634be7aa3530ad3e934a187f630bd6fd
|
||||
Subproject commit cbb65009ffc443bc88137f2758228c1b185d8d20
|
Loading…
Reference in New Issue
Block a user