mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 14:21:57 +00:00
[egl] texture: use more appropriate vairable names (parent & this)
This commit is contained in:
parent
3d7dbd6371
commit
88c91d4752
1 changed files with 19 additions and 18 deletions
|
@ -61,25 +61,26 @@ static bool eglTexFB_init(EGL_Texture ** texture, EGLDisplay * display)
|
||||||
|
|
||||||
static bool eglTexFB_update(EGL_Texture * texture, const EGL_TexUpdate * update)
|
static bool eglTexFB_update(EGL_Texture * texture, const EGL_TexUpdate * update)
|
||||||
{
|
{
|
||||||
TextureBuffer * this = UPCAST(TextureBuffer, texture);
|
TextureBuffer * parent = UPCAST(TextureBuffer, texture);
|
||||||
TexFB * fb = UPCAST(TexFB, this);
|
TexFB * this = UPCAST(TexFB , parent );
|
||||||
|
|
||||||
assert(update->type == EGL_TEXTYPE_FRAMEBUFFER);
|
assert(update->type == EGL_TEXTYPE_FRAMEBUFFER);
|
||||||
|
|
||||||
LG_LOCK(this->copyLock);
|
LG_LOCK(parent->copyLock);
|
||||||
|
|
||||||
struct TexDamage * damage = fb->damage + this->bufIndex;
|
struct TexDamage * damage = this->damage + parent->bufIndex;
|
||||||
bool damageAll = !update->rects || update->rectCount == 0 || damage->count < 0 ||
|
bool damageAll = !update->rects || update->rectCount == 0 || damage->count < 0 ||
|
||||||
damage->count + update->rectCount > KVMFR_MAX_DAMAGE_RECTS;
|
damage->count + update->rectCount > KVMFR_MAX_DAMAGE_RECTS;
|
||||||
|
|
||||||
if (damageAll)
|
if (damageAll)
|
||||||
framebuffer_read(
|
framebuffer_read(
|
||||||
update->frame,
|
update->frame,
|
||||||
this->buf[this->bufIndex].map,
|
parent->buf[parent->bufIndex].map,
|
||||||
this->format.stride,
|
parent->format.stride,
|
||||||
this->format.height,
|
parent->format.height,
|
||||||
this->format.width,
|
parent->format.width,
|
||||||
this->format.bpp,
|
parent->format.bpp,
|
||||||
this->format.stride
|
parent->format.stride
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -89,20 +90,20 @@ static bool eglTexFB_update(EGL_Texture * texture, const EGL_TexUpdate * update)
|
||||||
rectsFramebufferToBuffer(
|
rectsFramebufferToBuffer(
|
||||||
damage->rects,
|
damage->rects,
|
||||||
damage->count,
|
damage->count,
|
||||||
this->buf[this->bufIndex].map,
|
parent->buf[parent->bufIndex].map,
|
||||||
this->format.stride,
|
parent->format.stride,
|
||||||
this->format.height,
|
parent->format.height,
|
||||||
update->frame,
|
update->frame,
|
||||||
this->format.stride
|
parent->format.stride
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->buf[this->bufIndex].updated = true;
|
parent->buf[parent->bufIndex].updated = true;
|
||||||
|
|
||||||
for (int i = 0; i < EGL_TEX_BUFFER_MAX; ++i)
|
for (int i = 0; i < EGL_TEX_BUFFER_MAX; ++i)
|
||||||
{
|
{
|
||||||
struct TexDamage * damage = fb->damage + i;
|
struct TexDamage * damage = this->damage + i;
|
||||||
if (i == this->bufIndex)
|
if (i == parent->bufIndex)
|
||||||
damage->count = 0;
|
damage->count = 0;
|
||||||
else if (update->rects && update->rectCount > 0 && damage->count >= 0 &&
|
else if (update->rects && update->rectCount > 0 && damage->count >= 0 &&
|
||||||
damage->count + update->rectCount <= KVMFR_MAX_DAMAGE_RECTS)
|
damage->count + update->rectCount <= KVMFR_MAX_DAMAGE_RECTS)
|
||||||
|
@ -115,7 +116,7 @@ static bool eglTexFB_update(EGL_Texture * texture, const EGL_TexUpdate * update)
|
||||||
damage->count = -1;
|
damage->count = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
LG_UNLOCK(this->copyLock);
|
LG_UNLOCK(parent->copyLock);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue